]> git.itanic.dy.fi Git - linux-stable/commit
i2c: mlxcpld: check correct size of maximum RECV_LEN packet
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 28 Jun 2020 11:52:44 +0000 (13:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2020 07:37:11 +0000 (09:37 +0200)
commitf3779a6c2adf66ac5e2f06395b2e51e6b8f4f401
tree9eeca6cd29e6851604c2b103726d510ab8e5a823
parentc6b239e3fef600a04d1cb20d8c73447003e21edd
i2c: mlxcpld: check correct size of maximum RECV_LEN packet

[ Upstream commit 597911287fcd13c3a4b4aa3e0a52b33d431e0a8e ]

I2C_SMBUS_BLOCK_MAX defines already the maximum number as defined in the
SMBus 2.0 specs. I don't see a reason to add 1 here. Also, fix the errno
to what is suggested for this error.

Fixes: c9bfdc7c16cb ("i2c: mlxcpld: Add support for smbus block read transaction")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Michael Shych <michaelsh@mellanox.com>
Tested-by: Michael Shych <michaelsh@mellanox.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-mlxcpld.c