diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-03-31 18:25:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:28 -0400 |
commit | bc5d8ac02f24d68efe8e267c96dd75c0531009ab (patch) | |
tree | 0876991e7a956532428169a10939588e9399a395 /drivers/video/cirrusfb.c | |
parent | 9e848062533207130667f6eaa748549367ccbedf (diff) |
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 <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/cirrusfb.c')
-rw-r--r-- | drivers/video/cirrusfb.c | 19 |
1 files changed, 7 insertions, 12 deletions
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) | |||
2090 | 2090 | ||
2091 | err_dealloc_cmap: | 2091 | err_dealloc_cmap: |
2092 | fb_dealloc_cmap(&info->cmap); | 2092 | fb_dealloc_cmap(&info->cmap); |
2093 | cinfo->unmap(info); | ||
2094 | framebuffer_release(info); | ||
2095 | return err; | 2093 | return err; |
2096 | } | 2094 | } |
2097 | 2095 | ||
@@ -2328,18 +2326,15 @@ static int __devinit cirrusfb_zorro_register(struct zorro_dev *z, | |||
2328 | zorro_set_drvdata(z, info); | 2326 | zorro_set_drvdata(z, info); |
2329 | 2327 | ||
2330 | ret = cirrusfb_register(info); | 2328 | ret = cirrusfb_register(info); |
2331 | if (ret) { | 2329 | if (!ret) |
2332 | if (btype == BT_PICASSO4) { | 2330 | return 0; |
2333 | iounmap(info->screen_base); | 2331 | |
2334 | iounmap(cinfo->regbase - 0x600000); | 2332 | if (btype == BT_PICASSO4 || board_addr > 0x01000000) |
2335 | } else if (board_addr > 0x01000000) | 2333 | iounmap(info->screen_base); |
2336 | iounmap(info->screen_base); | ||
2337 | } | ||
2338 | return ret; | ||
2339 | 2334 | ||
2340 | err_unmap_regbase: | 2335 | err_unmap_regbase: |
2341 | /* Parental advisory: explicit hack */ | 2336 | if (btype == BT_PICASSO4) |
2342 | iounmap(cinfo->regbase - 0x600000); | 2337 | iounmap(cinfo->regbase - 0x600000); |
2343 | err_release_region: | 2338 | err_release_region: |
2344 | release_region(board_addr, board_size); | 2339 | release_region(board_addr, board_size); |
2345 | err_release_fb: | 2340 | err_release_fb: |