From: Adrian Bunk Date: Wed, 12 Mar 2008 13:15:00 +0000 (+0100) Subject: i2c-amd756: Fix off-by-one X-Git-Tag: v2.6.25-rc6~32^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5edc68b8530ff1b3133d057350da98c93cca5a82;p=linux-2.6-omap-h63xx.git i2c-amd756: Fix off-by-one This patch fixes an off-by-one error spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Jean Delvare --- diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 573abe44084..2fa43183d37 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/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) {