Skip to content

Commit 5f215d2

Browse files
Dan Carpenterbzolnier
authored andcommitted
OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
We cap the upper bound of "fbnum" but we also need to check for negatives or make the type unsigned. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
1 parent 5fa1f45 commit 5f215d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/omap2/omapfb/omapfb-main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
14771477
static int omapfb_parse_vram_param(const char *param, int max_entries,
14781478
unsigned long *sizes, unsigned long *paddrs)
14791479
{
1480-
int fbnum;
1480+
unsigned int fbnum;
14811481
unsigned long size;
14821482
unsigned long paddr = 0;
14831483
char *p, *start;

0 commit comments

Comments
 (0)