[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130920135648.GA19879@redhat.com>
Date: Fri, 20 Sep 2013 09:56:48 -0400
From: Dave Jones <davej@...hat.com>
To: Dave Airlie <airlied@...hat.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@...il.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Rob Clark <robdclark@...il.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: gma500: remove double free in psbfb_create
This code appears to be calling psb_gtt_free_range twice with the same args.
(The second call didn't appear in the diff output, it's right after the mutex_unlock)
Spotted with Coverity, not tested due to lack of hardware.
Signed-off-by: Dave Jones <davej@...oraproject.org>
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 01dd7d2..d35ffc4 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -479,9 +479,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
mutex_unlock(&dev->struct_mutex);
return 0;
out_unref:
- if (backing->stolen)
- psb_gtt_free_range(dev, backing);
- else
+ if (!backing->stolen)
drm_gem_object_unreference(&backing->gem);
out_err1:
mutex_unlock(&dev->struct_mutex);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists