mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 09:02:00 +00:00
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>
This commit is contained in:
parent
baadac8b10
commit
5edc68b853
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user