Commit 987dd36c authored by Alexander Stein's avatar Alexander Stein Committed by Wolfram Sang

i2c: imx-lpi2c: clean rx/tx buffers upon new message

When start sending a new message clear the Rx & Tx buffer pointers in
order to avoid using stale pointers.
Signed-off-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Tested-by: default avatarEmanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent eeac8ede
......@@ -463,6 +463,8 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
if (num == 1 && msgs[0].len == 0)
goto stop;
lpi2c_imx->rx_buf = NULL;
lpi2c_imx->tx_buf = NULL;
lpi2c_imx->delivered = 0;
lpi2c_imx->msglen = msgs[i].len;
init_completion(&lpi2c_imx->complete);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment