Commit 0ab76581 authored by Russell King's avatar Russell King Committed by Bartlomiej Zolnierkiewicz

video: sa1100fb: fix video memory allocation leak

Don't leak the video memory allocation if register_framebuffer() fails.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent c244f8e4
...@@ -1262,8 +1262,11 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1262,8 +1262,11 @@ static int sa1100fb_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, fbi); platform_set_drvdata(pdev, fbi);
ret = register_framebuffer(&fbi->fb); ret = register_framebuffer(&fbi->fb);
if (ret < 0) if (ret < 0) {
goto failed; dma_free_wc(fbi->dev, fbi->map_size, fbi->map_cpu,
fbi->map_dma);
return ret;
}
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
fbi->freq_transition.notifier_call = sa1100fb_freq_transition; fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
...@@ -1274,9 +1277,6 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1274,9 +1277,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
/* This driver cannot be unloaded at the moment */ /* This driver cannot be unloaded at the moment */
return 0; return 0;
failed:
return ret;
} }
static struct platform_driver sa1100fb_driver = { static struct platform_driver sa1100fb_driver = {
......
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