Skip to content

Commit

Permalink
video/aty/atyfb_base.c: free when fb can't be registered
Browse files Browse the repository at this point in the history
Free buffer when the framebuffer can't be registered

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Apr 28, 2008
1 parent 57a7a6d commit 21b4d1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2621,10 +2621,13 @@ static int __devinit aty_init(struct fb_info *info)
#endif /* CONFIG_FB_ATY_CT */
info->var = var;

fb_alloc_cmap(&info->cmap, 256, 0);
if (fb_alloc_cmap(&info->cmap, 256, 0) < 0)
goto aty_init_exit;

if (register_framebuffer(info) < 0)
if (register_framebuffer(info) < 0) {
fb_dealloc_cmap(&info->cmap);
goto aty_init_exit;
}

fb_list = info;

Expand Down

0 comments on commit 21b4d1d

Please sign in to comment.