提交 1b2cfa2d 编写于 作者: W Wolfram Sang 提交者: Wolfram Sang

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: 886f6f83 ("i2c: octeon: Support I2C_M_RECV_LEN")
Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: NRobert Richter <rric@kernel.org>
Signed-off-by: NWolfram Sang <wsa@kernel.org>
上级 2f3a0828
......@@ -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];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册