diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/sm501fb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index f94ae84a58cd..dcd98793d568 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c | |||
@@ -159,6 +159,9 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, | |||
159 | break; | 159 | break; |
160 | 160 | ||
161 | case SM501_MEMF_PANEL: | 161 | case SM501_MEMF_PANEL: |
162 | if (size > inf->fbmem_len) | ||
163 | return -ENOMEM; | ||
164 | |||
162 | ptr = inf->fbmem_len - size; | 165 | ptr = inf->fbmem_len - size; |
163 | fbi = inf->fb[HEAD_CRT]; | 166 | fbi = inf->fb[HEAD_CRT]; |
164 | 167 | ||
@@ -172,9 +175,6 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, | |||
172 | if (fbi && ptr < fbi->fix.smem_len) | 175 | if (fbi && ptr < fbi->fix.smem_len) |
173 | return -ENOMEM; | 176 | return -ENOMEM; |
174 | 177 | ||
175 | if (ptr < 0) | ||
176 | return -ENOMEM; | ||
177 | |||
178 | break; | 178 | break; |
179 | 179 | ||
180 | case SM501_MEMF_CRT: | 180 | case SM501_MEMF_CRT: |