summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 14:08:21 +0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 14:08:21 +0400
commit057eeaee6803dafbbf2f79345643530e731ba7cb (patch)
treef9a2452a84d21d182a32fd2c92e5929a8e6f34b4 /drivers/video
parent8105c94bc4f94478c67afb7593724e4d684dd9c0 (diff)
downloadlinux-057eeaee6803dafbbf2f79345643530e731ba7cb.tar.xz
OMAPFB: use devm_kzalloc to allocate omapfb2_device
Use devm_kzalloc to allocate omapfb2_device. This fixes possible memory leak: drivers/video/omap2/omapfb/omapfb-main.c:2553 omapfb_probe() warn: possible memory leak of 'fbdev' Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 4fa9487a8720..477a20817d08 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1868,7 +1868,6 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
}
dev_set_drvdata(fbdev->dev, NULL);
- kfree(fbdev);
}
static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
@@ -2413,7 +2412,8 @@ static int __init omapfb_probe(struct platform_device *pdev)
goto err0;
}
- fbdev = kzalloc(sizeof(struct omapfb2_device), GFP_KERNEL);
+ fbdev = devm_kzalloc(&pdev->dev, sizeof(struct omapfb2_device),
+ GFP_KERNEL);
if (fbdev == NULL) {
r = -ENOMEM;
goto err0;