stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 1/3] i2c: imx-lpi2c: clean rx/tx buffers upon new message
@ 2023-04-01  1:44 Sasha Levin
  2023-04-01  1:44 ` [PATCH AUTOSEL 4.14 2/3] efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L Sasha Levin
  2023-04-01  1:44 ` [PATCH AUTOSEL 4.14 3/3] verify_pefile: relax wrapper length check Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2023-04-01  1:44 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Alexander Stein, Emanuele Ghidoli, Wolfram Sang, Sasha Levin,
	aisheng.dong, shawnguo, linux-i2c, linux-imx, linux-arm-kernel

From: Alexander Stein <alexander.stein@ew.tq-group.com>

[ Upstream commit 987dd36c0141f6ab9f0fbf14d6b2ec3342dedb2f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/i2c/busses/i2c-imx-lpi2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index e86801a631206..dc89d8049d0f5 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -475,6 +475,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);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-01  1:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01  1:44 [PATCH AUTOSEL 4.14 1/3] i2c: imx-lpi2c: clean rx/tx buffers upon new message Sasha Levin
2023-04-01  1:44 ` [PATCH AUTOSEL 4.14 2/3] efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L Sasha Levin
2023-04-01  1:44 ` [PATCH AUTOSEL 4.14 3/3] verify_pefile: relax wrapper length check Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).