Commit 6b04e9f2 authored by Markus Elfring's avatar Markus Elfring Committed by Bartlomiej Zolnierkiewicz

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent ffb66624
...@@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev) ...@@ -242,16 +242,13 @@ static int dnfb_probe(struct platform_device *dev)
info->screen_base = (u_char *) info->fix.smem_start; info->screen_base = (u_char *) info->fix.smem_start;
err = fb_alloc_cmap(&info->cmap, 2, 0); err = fb_alloc_cmap(&info->cmap, 2, 0);
if (err < 0) { if (err < 0)
framebuffer_release(info); goto release_framebuffer;
return err;
}
err = register_framebuffer(info); err = register_framebuffer(info);
if (err < 0) { if (err < 0) {
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
framebuffer_release(info); goto release_framebuffer;
return err;
} }
platform_set_drvdata(dev, info); platform_set_drvdata(dev, info);
...@@ -265,6 +262,10 @@ static int dnfb_probe(struct platform_device *dev) ...@@ -265,6 +262,10 @@ static int dnfb_probe(struct platform_device *dev)
printk("apollo frame buffer alive and kicking !\n"); printk("apollo frame buffer alive and kicking !\n");
return err; return err;
release_framebuffer:
framebuffer_release(info);
return err;
} }
static struct platform_driver dnfb_driver = { static struct platform_driver dnfb_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