Skip to content

Commit 1b2cfa2

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: octeon: check correct size of maximum RECV_LEN packet
I2C_SMBUS_BLOCK_MAX defines already the maximum number as defined in the SMBus 2.0 specs. No reason to add one to it. Fixes: 886f6f8 ("i2c: octeon: Support I2C_M_RECV_LEN") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Robert Richter <rric@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 2f3a082 commit 1b2cfa2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-octeon-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
347347
if (result)
348348
return result;
349349
if (recv_len && i == 0) {
350-
if (data[i] > I2C_SMBUS_BLOCK_MAX + 1)
350+
if (data[i] > I2C_SMBUS_BLOCK_MAX)
351351
return -EPROTO;
352352
length += data[i];
353353
}

0 commit comments

Comments
 (0)