Sfoglia il codice sorgente

i2c-amd756: Fix off-by-one

This patch fixes an off-by-one error spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Adrian Bunk 17 anni fa
parent
commit
5edc68b853
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      drivers/i2c/busses/i2c-amd756.c

+ 1 - 1
drivers/i2c/busses/i2c-amd756.c

@@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
 	u8 temp;
 	
 	/* driver_data might come from user-space, so check it */
-	if (id->driver_data > ARRAY_SIZE(chipname))
+	if (id->driver_data >= ARRAY_SIZE(chipname))
 		return -EINVAL;
 
 	if (amd756_ioport) {