Commit 5edc68b8 authored by Adrian Bunk's avatar Adrian Bunk Committed by Jean Delvare

i2c-amd756: Fix off-by-one

This patch fixes an off-by-one error spotted by the Coverity checker.
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent baadac8b
...@@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev, ...@@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
u8 temp; u8 temp;
/* driver_data might come from user-space, so check it */ /* 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; return -EINVAL;
if (amd756_ioport) { if (amd756_ioport) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment