diff --git a/[refs] b/[refs] index b346013bdf6d..0e98222ce457 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd002050becd888e4dab419aa59a6484afe1d00b +refs/heads/master: c00b1b7d19d335f96aa03ef2e4e71b7fb4fdb056 diff --git a/trunk/drivers/video/sm501fb.c b/trunk/drivers/video/sm501fb.c index f94ae84a58cd..dcd98793d568 100644 --- a/trunk/drivers/video/sm501fb.c +++ b/trunk/drivers/video/sm501fb.c @@ -159,6 +159,9 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, break; case SM501_MEMF_PANEL: + if (size > inf->fbmem_len) + return -ENOMEM; + ptr = inf->fbmem_len - size; fbi = inf->fb[HEAD_CRT]; @@ -172,9 +175,6 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, if (fbi && ptr < fbi->fix.smem_len) return -ENOMEM; - if (ptr < 0) - return -ENOMEM; - break; case SM501_MEMF_CRT: