Commit 057eeaee authored by Tomi Valkeinen's avatar Tomi Valkeinen

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 8105c94b
...@@ -1868,7 +1868,6 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev) ...@@ -1868,7 +1868,6 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
} }
dev_set_drvdata(fbdev->dev, NULL); dev_set_drvdata(fbdev->dev, NULL);
kfree(fbdev);
} }
static int omapfb_create_framebuffers(struct omapfb2_device *fbdev) static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
...@@ -2413,7 +2412,8 @@ static int __init omapfb_probe(struct platform_device *pdev) ...@@ -2413,7 +2412,8 @@ static int __init omapfb_probe(struct platform_device *pdev)
goto err0; goto err0;
} }
fbdev = kzalloc(sizeof(struct omapfb2_device), GFP_KERNEL); fbdev = devm_kzalloc(&pdev->dev, sizeof(struct omapfb2_device),
GFP_KERNEL);
if (fbdev == NULL) { if (fbdev == NULL) {
r = -ENOMEM; r = -ENOMEM;
goto err0; goto err0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment