diff options
author | Andres Salomon <dilinger@queued.net> | 2009-04-01 00:25:24 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 17:59:30 +0200 |
commit | 0a5d924e5954e81a905907512f8c7a1cbf81d700 (patch) | |
tree | f8caf5debe410a06f3783fe88b5f05796a8a70c9 /drivers/video/sm501fb.c | |
parent | skeletonfb: check fb_alloc_cmap return value and handle failure properly (diff) | |
download | linux-0a5d924e5954e81a905907512f8c7a1cbf81d700.tar.xz linux-0a5d924e5954e81a905907512f8c7a1cbf81d700.zip |
sm501fb: check fb_alloc_cmap return value and handle failure properly
Signed-off-by: Andres Salomon <dilinger@debian.org>
Acked-by: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/sm501fb.c')
-rw-r--r-- | drivers/video/sm501fb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index dcd98793d568..eb5d73a06702 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c @@ -1525,7 +1525,10 @@ static int sm501fb_init_fb(struct fb_info *fb, } /* initialise and set the palette */ - fb_alloc_cmap(&fb->cmap, NR_PALETTE, 0); + if (fb_alloc_cmap(&fb->cmap, NR_PALETTE, 0)) { + dev_err(info->dev, "failed to allocate cmap memory\n"); + return -ENOMEM; + } fb_set_cmap(&fb->cmap, fb); ret = (fb->fbops->fb_check_var)(&fb->var, fb); |