aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2017-11-17 16:21:49 +0000
committerBartlomiej Zolnierkiewicz <[email protected]>2017-11-17 16:21:49 +0000
commit5f215d252496543ba22299bccef5062d30d63cfe (patch)
treea991f9862eb12e91ded049f2059a894f4eeb785d
parentvideo: fbdev: sm501fb: fix potential null pointer dereference on fbi (diff)
downloadkernel-5f215d252496543ba22299bccef5062d30d63cfe.tar.gz
kernel-5f215d252496543ba22299bccef5062d30d63cfe.zip
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 <[email protected]> Cc: Tomi Valkeinen <[email protected]> Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
-rw-r--r--drivers/video/fbdev/omap2/omapfb/omapfb-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index 1d7c012f09db..e08e5664e330 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -1477,7 +1477,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
static int omapfb_parse_vram_param(const char *param, int max_entries,
unsigned long *sizes, unsigned long *paddrs)
{
- int fbnum;
+ unsigned int fbnum;
unsigned long size;
unsigned long paddr = 0;
char *p, *start;