aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaotian Feng <dfeng@redhat.com>2009-07-29 21:28:24 +0800
committerDave Airlie <airlied@redhat.com>2009-08-04 13:41:05 +1000
commitc9b7fb54f0a51e587fa09be3a85666b43d36a850 (patch)
tree347d4910612b2e3105f1e35e0b440da8b7af17f3
parentde05065ff5d6878523317ff4a0b48a1239f80f73 (diff)
drm/radeon/kms: fix memory leak in radeon_driver_load_kms
This patch fixes following kmemleak report: unreferenced object 0xffff88022cb53000 (size 4096): comm "work_for_cpu", pid 97, jiffies 4294672345 backtrace: [<ffffffff810eb222>] create_object+0x19f/0x2a0 [<ffffffff810eb422>] kmemleak_alloc+0x26/0x4c [<ffffffff810e363f>] __kmalloc+0x187/0x1b0 [<ffffffffa005f3db>] kzalloc.clone.0+0x13/0x15 [radeon] [<ffffffffa005f403>] radeon_driver_load_kms+0x26/0xe1 [radeon] [<ffffffffa0017432>] drm_get_dev+0x37f/0x480 [drm] [<ffffffffa007f424>] radeon_pci_probe+0x15/0x269 [radeon] [<ffffffff811f8779>] local_pci_probe+0x17/0x1b [<ffffffff8105ffbb>] do_work_for_cpu+0x18/0x2a [<ffffffff81063c38>] kthread+0x8a/0x92 [<ffffffff81012cba>] child_rip+0xa/0x20 [<ffffffffffffffff>] 0xffffffffffffffff Signed-off-by: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 937a2f1cdb4..3357110e30c 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -58,6 +58,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
if (r) {
DRM_ERROR("Failed to initialize radeon, disabling IOCTL\n");
radeon_device_fini(rdev);
+ kfree(rdev);
+ dev->dev_private = NULL;
return r;
}
return 0;