V4L/DVB (3499): Fix a bug when more than MAXBOARDS were plugged on em28xx
authorMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 14 Mar 2006 20:24:57 +0000 (17:24 -0300)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 21 Mar 2006 16:53:26 +0000 (08:53 -0800)
Coverity reported a bug at checking max number of supported boards by
em28xx init code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/em28xx/em28xx-video.c

index f56ae4852165e1dba939527a7e70c870f7aaf663..78f0f7a706ea759c3741eb140c808ad32d371640 100644 (file)
@@ -1949,7 +1949,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
 
        model=id->driver_info;
 
-       if (nr > EM28XX_MAXBOARDS) {
+       if (nr >= EM28XX_MAXBOARDS) {
                printk (DRIVER_NAME ": Supports only %i em28xx boards.\n",EM28XX_MAXBOARDS);
                em28xx_devused&=~(1<<nr);
                return -ENOMEM;