Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Bunk and committed by
Jean Delvare
5edc68b8 baadac8b

+1 -1
+1 -1
drivers/i2c/busses/i2c-amd756.c
··· 335 335 u8 temp; 336 336 337 337 /* driver_data might come from user-space, so check it */ 338 - if (id->driver_data > ARRAY_SIZE(chipname)) 338 + if (id->driver_data >= ARRAY_SIZE(chipname)) 339 339 return -EINVAL; 340 340 341 341 if (amd756_ioport) {