fbmem: fix con2fbmap limit check
authorPeter Samuelson <[email protected]>
Mon, 28 Apr 2008 09:15:03 +0000 (02:15 -0700)
committerLinus Torvalds <[email protected]>
Mon, 28 Apr 2008 15:58:36 +0000 (08:58 -0700)
Fix limit check in FBIOPUT_CON2FBMAP ioctl.

Signed-off-by: Peter Samuelson <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: "Antonino A. Daplas" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/video/fbmem.c

index 279c2dbef8f8cbca800f1ec9babe06423da727e2..0c1461b26dd63b2f2b2ae1770832c04eb9f1c7ae 100644 (file)
@@ -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;