aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Stein2023-01-30 16:32:46 +0100
committerWolfram Sang2023-03-16 20:35:26 +0100
commit987dd36c0141f6ab9f0fbf14d6b2ec3342dedb2f (patch)
treef99fcbb43bd429b3e42c94117b57f5ea7697adaa
parenteeac8ede17557680855031c6f305ece2378af326 (diff)
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 <alexander.stein@ew.tq-group.com> Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
-rw-r--r--drivers/i2c/busses/i2c-imx-lpi2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 188f2a36d2fd..c6d0225246e6 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -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);