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

i2c: qup: off by ones in qup_i2c_probe()

These should ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Fixes: 10c5a8425968 ('i2c: qup: New bus driver for the Qualcomm QUP I2C controller')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Dan Carpenter and committed by
Wolfram Sang
199c1df2 3428f018

+2 -2
+2 -2
drivers/i2c/busses/i2c-qup.c
··· 633 633 * associated with each byte written/received 634 634 */ 635 635 size = QUP_OUTPUT_BLOCK_SIZE(io_mode); 636 - if (size > ARRAY_SIZE(blk_sizes)) 636 + if (size >= ARRAY_SIZE(blk_sizes)) 637 637 return -EIO; 638 638 qup->out_blk_sz = blk_sizes[size] / 2; 639 639 640 640 size = QUP_INPUT_BLOCK_SIZE(io_mode); 641 - if (size > ARRAY_SIZE(blk_sizes)) 641 + if (size >= ARRAY_SIZE(blk_sizes)) 642 642 return -EIO; 643 643 qup->in_blk_sz = blk_sizes[size] / 2; 644 644