|
@@ -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;
|
|
|
|