stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
	Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	Wolfram Sang <wsa@kernel.org>, Sasha Levin <sashal@kernel.org>,
	aisheng.dong@nxp.com, shawnguo@kernel.org,
	linux-i2c@vger.kernel.org, linux-imx@nxp.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 6.1 08/24] i2c: imx-lpi2c: clean rx/tx buffers upon new message
Date: Fri, 31 Mar 2023 21:42:24 -0400	[thread overview]
Message-ID: <20230401014242.3356780-8-sashal@kernel.org> (raw)
In-Reply-To: <20230401014242.3356780-1-sashal@kernel.org>

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 9b2f9544c5681..a49b14d52a986 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.39.2


  parent reply	other threads:[~2023-04-01  1:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01  1:42 [PATCH AUTOSEL 6.1 01/24] ARM: 9290/1: uaccess: Fix KASAN false-positives Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 02/24] ARM: dts: qcom: apq8026-lg-lenok: add missing reserved memory Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 03/24] power: supply: rk817: Fix unsigned comparison with less than zero Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 04/24] power: supply: cros_usbpd: reclassify "default case!" as debug Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 05/24] power: supply: axp288_fuel_gauge: Added check for negative values Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 06/24] selftests/bpf: Fix progs/find_vma_fail1.c build error Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 07/24] wifi: mwifiex: mark OF related data as maybe unused Sasha Levin
2023-04-01  1:42 ` Sasha Levin [this message]
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 09/24] i2c: hisi: Avoid redundant interrupts Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 10/24] efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 11/24] block: ublk_drv: mark device as LIVE before adding disk Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 12/24] ACPI: video: Add backlight=native DMI quirk for Acer Aspire 3830TG Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 13/24] drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 14/24] hwmon: (peci/cputemp) Fix miscalculated DTS for SKX Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 15/24] hwmon: (xgene) Fix ioremap and memremap leak Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 16/24] verify_pefile: relax wrapper length check Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 17/24] asymmetric_keys: log on fatal failures in PE/pkcs7 Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 18/24] nvme: send Identify with CNS 06h only to I/O controllers Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 19/24] wifi: iwlwifi: mvm: fix mvmtxq->stopped handling Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 20/24] wifi: iwlwifi: mvm: protect TXQ list manipulation Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 21/24] drm/amdgpu: add mes resume when do gfx post soft reset Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 22/24] drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 23/24] drm/amdgpu/gfx: set cg flags to enter/exit safe mode Sasha Levin
2023-04-01  1:42 ` [PATCH AUTOSEL 6.1 24/24] ACPI: resource: Add Medion S17413 to IRQ override quirk Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230401014242.3356780-8-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=aisheng.dong@nxp.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).