From patchwork Mon Oct 17 13:14:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amelie Delaunay X-Patchwork-Id: 13008860 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 DF048C4332F for ; Mon, 17 Oct 2022 13:15:36 +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: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:In-Reply-To:References: List-Owner; bh=jqwIkU4GrTMp668detw5slXfgxKHSywTMspiiOObOjM=; b=BSaPzS70KQV+Ao e7x09fKrD8emLNNcEeAJN76VVsNVf3f3b9hi9EN2JZXbrqvQUkbamJH9mRmq22H0oDwYrQcqPe/Yr Gvy9wTViUCwF9AIgFaltPkwEiqZRmqPD4WR/Y9nYbxaTX0IJIfSv8qaPBNFTZpx33S9iiyHciMBE9 Q9Bfk7RQLxg21czaQpnmltDZ8n1nKYfIk1MVOjqDZMPghckWdkRfuYciFFQwkRYsNF8S3P+t53Kuf MEPLTG4iYUey5DBEo8EwWhVxMBkGSV9SeS1deoSojlWOsEE5xekQxWXtJ7Dlx1ak77OJj/h05nytc wOdGuRck1r4RFDjkCvLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okPww-00C5Sr-Sx; Mon, 17 Oct 2022 13:14:35 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okPws-00C5QM-HW for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 13:14:32 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29HCE0Eh022314; Mon, 17 Oct 2022 15:14:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=Y3tbg4T/k0TWNQzttJhU7tjvx6Th49Ldu2bCDMrA3Ls=; b=4fBFnwBvxgk3rI4psrux/cfqJ9fk8aMc9jTxCUg+o6cv1uosNTEBY29sUR0eVCj8wxcl Qv4fpZHA8bYpRn/nrwmtb5Z6eqflWrzKFlOXvKM88PeOUQfjUo8wiac36y01JTnCH3tR 9SdWZ/giIhAxQAsWucW1JyZ/UFu4IVoJJ61eGLw7KLVZU/pTGaySCl20HZ+xIWD3Sr6f YBtQNxkTqvjO++tzAaov0sclC2J5G3DR+bfIzUXWKYxSHfE5u7rREhAD9/AbUDaKqz0U wp9mjHrTroxyr5PVQUS4tvXU7U4ok3Uc03HfXY0eleBu1G3rg8BSNBAb59xKKisY+COU YQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3k7krjmmb3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Oct 2022 15:14:19 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9876710002A; Mon, 17 Oct 2022 15:14:14 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 93CE822FA3D; Mon, 17 Oct 2022 15:14:14 +0200 (CEST) Received: from localhost (10.75.127.46) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Mon, 17 Oct 2022 15:14:13 +0200 From: Amelie Delaunay To: Vinod Koul , Maxime Coquelin , Alexandre Torgue , Amelie Delaunay CC: , , , Subject: [PATCH] dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it Date: Mon, 17 Oct 2022 15:14:13 +0200 Message-ID: <20221017131413.202567-1-amelie.delaunay@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-17_10,2022-10-17_02,2022-06-22_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_061431_020414_E0659E6D X-CRM114-Status: GOOD ( 14.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org New bool m2m_hw has been added at the end of stm32_mdma_chan_config struct to support the STM32 DMA MDMA chaining. m2m_hw is set true in stm32_mdma_slave_config() if peripheral_size is set, but m2m_hw is never initialized false. To ensure this case, and any further new update of the structure, memset it to 0 before using it. Fixes: 696874322771 ("dmaengine: stm32-mdma: add support to be triggered by STM32 DMA") Signed-off-by: Amelie Delaunay --- drivers/dma/stm32-mdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index e28acbcb53f4..b9d4c843635f 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1539,6 +1539,7 @@ static struct dma_chan *stm32_mdma_of_xlate(struct of_phandle_args *dma_spec, return NULL; } + memset(&config, 0, sizeof(config)); config.request = dma_spec->args[0]; config.priority_level = dma_spec->args[1]; config.transfer_config = dma_spec->args[2];