1
0
Fork 0

video/fbdev/dnfb: Use common error handling code in dnfb_probe()

Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
hifive-unleashed-5.1
Markus Elfring 2017-11-09 18:09:31 +01:00 committed by Bartlomiej Zolnierkiewicz
parent ffb66624ca
commit 6b04e9f256
1 changed files with 7 additions and 6 deletions

View File

@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev)
info->screen_base = (u_char *) info->fix.smem_start;
err = fb_alloc_cmap(&info->cmap, 2, 0);
if (err < 0) {
framebuffer_release(info);
return err;
}
if (err < 0)
goto release_framebuffer;
err = register_framebuffer(info);
if (err < 0) {
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
return err;
goto release_framebuffer;
}
platform_set_drvdata(dev, info);
@ -265,6 +262,10 @@ static int dnfb_probe(struct platform_device *dev)
printk("apollo frame buffer alive and kicking !\n");
return err;
release_framebuffer:
framebuffer_release(info);
return err;
}
static struct platform_driver dnfb_driver = {