From 57a7a6db0eed2862072497116232f57a6843cadd Mon Sep 17 00:00:00 2001 From: Peter Samuelson Date: Mon, 28 Apr 2008 02:15:03 -0700 Subject: fbmem: fix con2fbmap limit check Fix limit check in FBIOPUT_CON2FBMAP ioctl. Signed-off-by: Peter Samuelson Cc: Geert Uytterhoeven Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 279c2dbef8f..0c1461b26dd 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1057,7 +1057,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case FBIOPUT_CON2FBMAP: if (copy_from_user(&con2fb, argp, sizeof(con2fb))) return - EFAULT; - if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES) + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) return -EINVAL; if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) return -EINVAL; -- cgit v1.2.3-18-g5258