]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: i2c: Fix buffer increment counter for write transaction
authorVadim Pasternak <vadimp@mellanox.com>
Wed, 1 Nov 2017 11:10:42 +0000 (12:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Nov 2017 11:40:58 +0000 (20:40 +0900)
commitdb4b127a65c32c6df26ae00bc56c7674dc25117c
treee7ec45ab653b8941a19d360e22d2e9af8000ecb2
parentad733d7d7d09ecd9d677b6519b97f99ebc5a7f80
mlxsw: i2c: Fix buffer increment counter for write transaction

It fixes a problem for the last chunk where 'chunk_size' is smaller than
MLXSW_I2C_BLK_MAX and data is copied to the wrong offset, overriding
previous data.

Fixes: 2456421867a0 ("mlxsw: Introduce support for I2C bus")
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/i2c.c