From: Krzysztof Helt Date: Tue, 31 Mar 2009 22:25:12 +0000 (-0700) Subject: cirrusfb: fix error paths in cirrusfb_xxx_register() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bc5d8ac02f24d68efe8e267c96dd75c0531009ab;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git cirrusfb: fix error paths in cirrusfb_xxx_register() Balance iomap and iounmap and alloc and free calls in case of error druing device register (probing). Signed-off-by: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index a2a09b39c59a..ffc514df2452 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -2090,8 +2090,6 @@ static int __devinit cirrusfb_register(struct fb_info *info) err_dealloc_cmap: fb_dealloc_cmap(&info->cmap); - cinfo->unmap(info); - framebuffer_release(info); return err; } @@ -2328,18 +2326,15 @@ static int __devinit cirrusfb_zorro_register(struct zorro_dev *z, zorro_set_drvdata(z, info); ret = cirrusfb_register(info); - if (ret) { - if (btype == BT_PICASSO4) { - iounmap(info->screen_base); - iounmap(cinfo->regbase - 0x600000); - } else if (board_addr > 0x01000000) - iounmap(info->screen_base); - } - return ret; + if (!ret) + return 0; + + if (btype == BT_PICASSO4 || board_addr > 0x01000000) + iounmap(info->screen_base); err_unmap_regbase: - /* Parental advisory: explicit hack */ - iounmap(cinfo->regbase - 0x600000); + if (btype == BT_PICASSO4) + iounmap(cinfo->regbase - 0x600000); err_release_region: release_region(board_addr, board_size); err_release_fb: