Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 312D4C77B61 for ; Sat, 1 Apr 2023 01:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w41P8oOuEbaHcGgV7+ACGt/HgveAU0tsYv1SbFlXtGc=; b=MQQkGw7QW93RPL LOsQXmUt28qTGciyDY3hrsnuq2CjN6hsEyPnGW/8htXEaT7HbTR13aaOY8rUa6UmRMyk2ZPduqHL6 kXyfgQEVC6CTH7+tHrlJ5Amtj5nPzGhBczyEg/6xBobWT7eHUbSkQXSGwN5QX1IvQeIDee394ktsw tZGHX9GReH39JKoAfw0+xYaduaSPGecoqBNPh3daQTb7mqPe+v8MA53ajepNHeN7adSuheyPqM59r rtbY5XP8s7V53V3y/O9Ec0cj8DJGopi8oYIbHCZUjzXgLaCyn6Zq6oml8kRiSIACdk7QQh+olx8PF 5neeSynHxQbHkBj0n5TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piQGj-009U49-1D; Sat, 01 Apr 2023 01:43:01 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piQGg-009U36-0E for linux-arm-kernel@lists.infradead.org; Sat, 01 Apr 2023 01:42:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9514262D02; Sat, 1 Apr 2023 01:42:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F09BEC433D2; Sat, 1 Apr 2023 01:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680313377; bh=uPMOlphHBamsx4/oDxVMrw3tPvD+rItJxPuTUtzs+Kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OQtrPbrhMhXNzRu+rJn/dm4BYLdnyLT98/U4MpIPTfKXNrNAHTFQDpVWzjrlQ6+6y qwGpeACULh+rHX3eD47h1PtxP5BMFso1CBp3uwHfkC1pfvTbUpSWgzQyjTjclAadiT yMofZqxBtLDFYsM2GqLQZbMUZK29RGMc/1KnsmhsyRPiQ7biZ9skSN+x2DuYUxmpPx t9KAFWmcq9X3DbA88gFnXA4FvyS1j0BTcfyplaETK2zdrScQEOSkS22gMULaa/2zw+ Peo0y8dDcD+ANUhmTiUlEjW5QoLUFCW7q+XpiXheyLQVJo4EmXWMFwq9e5vsm1AQNd W0W6o3OevVJ1g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Stein , Emanuele Ghidoli , Wolfram Sang , Sasha Levin , 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 Message-Id: <20230401014242.3356780-8-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230401014242.3356780-1-sashal@kernel.org> References: <20230401014242.3356780-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230331_184258_160366_3CC9D835 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alexander Stein [ 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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel