diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-10-17 16:01:13 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-10-17 16:01:13 +0200 |
commit | 0ab76581a9fee0413c54907076fcd79fcc271843 (patch) | |
tree | d4e44828f01f82426924cab3de91f9e15c650263 /drivers/video/fbdev/sa1100fb.c | |
parent | video: sa1100fb: clean up failure path (diff) | |
download | linux-0ab76581a9fee0413c54907076fcd79fcc271843.tar.xz linux-0ab76581a9fee0413c54907076fcd79fcc271843.zip |
video: sa1100fb: fix video memory allocation leak
Don't leak the video memory allocation if register_framebuffer() fails.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev/sa1100fb.c')
-rw-r--r-- | drivers/video/fbdev/sa1100fb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c index 16a974471c02..56d514b5d252 100644 --- a/drivers/video/fbdev/sa1100fb.c +++ b/drivers/video/fbdev/sa1100fb.c @@ -1262,8 +1262,11 @@ static int sa1100fb_probe(struct platform_device *pdev) platform_set_drvdata(pdev, fbi); ret = register_framebuffer(&fbi->fb); - if (ret < 0) - goto failed; + if (ret < 0) { + dma_free_wc(fbi->dev, fbi->map_size, fbi->map_cpu, + fbi->map_dma); + return ret; + } #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = sa1100fb_freq_transition; @@ -1274,9 +1277,6 @@ static int sa1100fb_probe(struct platform_device *pdev) /* This driver cannot be unloaded at the moment */ return 0; - - failed: - return ret; } static struct platform_driver sa1100fb_driver = { |