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>
This commit is contained in:
Russell King 2017-10-17 16:01:13 +02:00 committed by Bartlomiej Zolnierkiewicz
parent c244f8e48c
commit 0ab76581a9
1 changed files with 5 additions and 5 deletions

View File

@ -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 = {