[SCSI] Overrun in drivers/scsi/sim710.c
authorEric Sesterhenn <snakebyte@gmx.de>
Wed, 19 Apr 2006 04:09:20 +0000 (21:09 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Thu, 20 Apr 2006 00:51:38 +0000 (20:51 -0400)
This fixes coverity bug id #480.  Since id_array is declared as
id_array[MAX_SLOTS], the check for i>MAX_SLOTS is obviously false.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/sim710.c

index 3274ab7..255886a 100644 (file)
@@ -75,7 +75,7 @@ param_setup(char *str)
                else if(!strncmp(pos, "id:", 3)) {
                        if(slot == -1) {
                                printk(KERN_WARNING "sim710: Must specify slot for id parameter\n");
-                       } else if(slot > MAX_SLOTS) {
+                       } else if(slot >= MAX_SLOTS) {
                                printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val);
                        } else {
                                id_array[slot] = val;