Skip to content

Commit 987dd36

Browse files
tq-steinawsakernel
authored andcommitted
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: Alexander Stein <[email protected]> Tested-by: Emanuele Ghidoli <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent eeac8ed commit 987dd36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
463463
if (num == 1 && msgs[0].len == 0)
464464
goto stop;
465465

466+
lpi2c_imx->rx_buf = NULL;
467+
lpi2c_imx->tx_buf = NULL;
466468
lpi2c_imx->delivered = 0;
467469
lpi2c_imx->msglen = msgs[i].len;
468470
init_completion(&lpi2c_imx->complete);

0 commit comments

Comments
 (0)