diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-05-21 15:42:55 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-24 03:26:26 -0400 |
commit | a707642a0653c457376068d9d4a77afe93c10c93 (patch) | |
tree | ecb9644e592647971110545e9c62a7bf546ffe81 /drivers/video/amifb.c | |
parent | e3e4e9c61eb7bbd1171a2b948f1ea4591bac8289 (diff) |
fbdev/amifb: Do not call panic() if there's not enough Chip RAM
Fail gracefully instead.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/amifb.c')
-rw-r--r-- | drivers/video/amifb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 603f84fae6a1..1b0185cf6868 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c | |||
@@ -2230,8 +2230,10 @@ static inline u_long __init chipalloc(u_long size) | |||
2230 | { | 2230 | { |
2231 | size += PAGE_SIZE-1; | 2231 | size += PAGE_SIZE-1; |
2232 | if (!(unaligned_chipptr = (u_long)amiga_chip_alloc(size, | 2232 | if (!(unaligned_chipptr = (u_long)amiga_chip_alloc(size, |
2233 | "amifb [RAM]"))) | 2233 | "amifb [RAM]"))) { |
2234 | panic("No Chip RAM for frame buffer"); | 2234 | pr_err("amifb: No Chip RAM for frame buffer"); |
2235 | return 0; | ||
2236 | } | ||
2235 | memset((void *)unaligned_chipptr, 0, size); | 2237 | memset((void *)unaligned_chipptr, 0, size); |
2236 | return PAGE_ALIGN(unaligned_chipptr); | 2238 | return PAGE_ALIGN(unaligned_chipptr); |
2237 | } | 2239 | } |
@@ -2385,6 +2387,10 @@ default_chipset: | |||
2385 | DUMMYSPRITEMEMSIZE+ | 2387 | DUMMYSPRITEMEMSIZE+ |
2386 | COPINITSIZE+ | 2388 | COPINITSIZE+ |
2387 | 4*COPLISTSIZE); | 2389 | 4*COPLISTSIZE); |
2390 | if (!chipptr) { | ||
2391 | err = -ENOMEM; | ||
2392 | goto amifb_error; | ||
2393 | } | ||
2388 | 2394 | ||
2389 | assignchunk(videomemory, u_long, chipptr, fb_info.fix.smem_len); | 2395 | assignchunk(videomemory, u_long, chipptr, fb_info.fix.smem_len); |
2390 | assignchunk(spritememory, u_long, chipptr, SPRITEMEMSIZE); | 2396 | assignchunk(spritememory, u_long, chipptr, SPRITEMEMSIZE); |