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 70036C761A6 for ; Sat, 1 Apr 2023 01:45:31 +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=V1pY5A0BDUAy5jqUu9SMqfr0zOFrOHvNSl9q1qOE+jo=; b=OT/LebX31AiOj3 6ZY+1HfZxcUCvWAV1vHjTQgtf+MVUsRQ/DaqI0G8KwNoUUMhj9HlpjEYl6h5Uqqr7KQL/F4p3WOOr aAdRsIOYsDHP8t+QWjnUdsQh5kuksatVFw1c4bzCk2V6+oqa5NfPZJr+dq5UYoms9zVT+CE0POLjw HR9SOyM4CKkyfWuHR1G5QmNw1Y2o2x6p2l1dSOAYMF6nYGq0mdpL1iuK7eON8vLAwNByTaSt5sPA5 kZksuUyFLoKqiDqzgESGR5HKYz3aanoTPHf19Tno/Ur4oUm0Mt9tZKzk75kuPWtZN4XhsnQdSMa5H T9u1vNUwNXSBzGuJHjyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piQIL-009Uw8-12; Sat, 01 Apr 2023 01:44:41 +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 1piQIG-009Ut6-1z for linux-arm-kernel@lists.infradead.org; Sat, 01 Apr 2023 01:44:38 +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 39ED762D0C; Sat, 1 Apr 2023 01:44:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0759BC433AA; Sat, 1 Apr 2023 01:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680313476; bh=TfqizCxmOUIXmKrZIFlTXp/CWfTroRK54cf8/tJ/Ukc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a696U5FWAC1lXbT8fyN4+w9S6OQ2MBR1ziYin1WyyaKYa2c7JAGihWrSsA/DuOvpR 52Id+35jWxuZWWJZoD80h8aXVm9ILPA/Yn3fiI/xJHYz1YCgLrDszmcPvJmRDVXW8J 4g4lbKuStzH8inDYNvp2XqE9SFMqbU+6S7s/Jyv72mvke1Dbp1qghkeNw+OO4+VBEB Vro2xY2Akeff7FTMK81l3Viqaf1ysROOMwj+QmgXLXUWJoKvjtXDHj81Kadgh1I/dg wKqZZZ+uHCwFGZjkzo7iK3trsw0992w2NJsLzKcvjqstIHKF9qZ2pHTiI8N1i0gFsZ +pgQdXun9yRnQ== 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 5.4 2/6] i2c: imx-lpi2c: clean rx/tx buffers upon new message Date: Fri, 31 Mar 2023 21:44:27 -0400 Message-Id: <20230401014431.3357345-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230401014431.3357345-1-sashal@kernel.org> References: <20230401014431.3357345-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_184436_820150_46E9491F 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 a0d045c1bc9e6..843b3d2e1d984 100644 --- a/drivers/i2c/busses/i2c-imx-lpi2c.c +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c @@ -468,6 +468,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