diff --git a/patches.kernel.org/6.2.12-083-i2c-imx-lpi2c-clean-rx-tx-buffers-upon-new-mes.patch b/patches.kernel.org/6.2.12-083-i2c-imx-lpi2c-clean-rx-tx-buffers-upon-new-mes.patch new file mode 100644 index 0000000..6f11315 --- /dev/null +++ b/patches.kernel.org/6.2.12-083-i2c-imx-lpi2c-clean-rx-tx-buffers-upon-new-mes.patch @@ -0,0 +1,37 @@ +From: Alexander Stein +Date: Mon, 30 Jan 2023 16:32:46 +0100 +Subject: [PATCH] i2c: imx-lpi2c: clean rx/tx buffers upon new message +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 987dd36c0141f6ab9f0fbf14d6b2ec3342dedb2f + +[ 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 +Tested-by: Emanuele Ghidoli +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + 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 9b2f9544..a49b14d5 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); +-- +2.35.3 + diff --git a/series.conf b/series.conf index cf19cde..d88a51e 100644 --- a/series.conf +++ b/series.conf @@ -2310,6 +2310,7 @@ patches.kernel.org/6.2.12-080-power-supply-axp288_fuel_gauge-Added-check-for.patch patches.kernel.org/6.2.12-081-selftests-bpf-Fix-progs-find_vma_fail1.c-build.patch patches.kernel.org/6.2.12-082-wifi-mwifiex-mark-OF-related-data-as-maybe-unu.patch + patches.kernel.org/6.2.12-083-i2c-imx-lpi2c-clean-rx-tx-buffers-upon-new-mes.patch ######################################################## # Build fixes that apply to the vanilla kernel too.