Skip to content

Commit

Permalink
i2c: octeon: check correct size of maximum RECV_LEN packet
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Wolfram Sang committed Jan 17, 2021
1 parent 2f3a082 commit 1b2cfa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-octeon-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
if (result)
return result;
if (recv_len && i == 0) {
if (data[i] > I2C_SMBUS_BLOCK_MAX + 1)
if (data[i] > I2C_SMBUS_BLOCK_MAX)
return -EPROTO;
length += data[i];
}
Expand Down

0 comments on commit 1b2cfa2

Please sign in to comment.