Skip to content

Commit

Permalink
i2c-amd756: Fix off-by-one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and Jean Delvare committed Mar 12, 2008
1 parent baadac8 commit 5edc68b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-amd756.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5edc68b

Please sign in to comment.