lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ede5702c460a5b4b41186a8cff1e3c29b2380c08.1518110810.git.sean.wang@mediatek.com>
Date:   Fri, 9 Feb 2018 01:58:51 +0800
From:   <sean.wang@...iatek.com>
To:     <vinod.koul@...el.com>, <dan.j.williams@...el.com>,
        <robh+dt@...nel.org>, <mark.rutland@....com>
CC:     <dmaengine@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        Fengguang Wu <fengguang.wu@...el.com>,
        Sean Wang <sean.wang@...iatek.com>,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH v4 5/5] dmaengine: mediatek: fix zalloc-simple.cocci warnings

From: Fengguang Wu <fengguang.wu@...el.com>

 Use zeroing allocator rather than allocator followed by memset with 0

Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci

Fixes: c8e4b2e4ca21 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
Cc: Sean Wang <sean.wang@...iatek.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...6.fr>
Signed-off-by: Sean Wang <sean.wang@...iatek.com>
---
 drivers/dma/mediatek/mtk-hsdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index 42b5b23..d3b90fe 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -325,13 +325,11 @@ static int mtk_hsdma_alloc_pchan(struct mtk_hsdma_device *hsdma,
 	 * and [MTK_DMA_SIZE ... 2 * MTK_DMA_SIZE - 1] is for RX ring.
 	 */
 	pc->sz_ring = 2 * MTK_DMA_SIZE * sizeof(*ring->txd);
-	ring->txd = dma_alloc_coherent(hsdma2dev(hsdma),
-				       pc->sz_ring, &ring->tphys,
-				       GFP_ATOMIC | __GFP_ZERO);
+	ring->txd = dma_zalloc_coherent(hsdma2dev(hsdma), pc->sz_ring,
+					&ring->tphys, GFP_ATOMIC);
 	if (!ring->txd)
 		return -ENOMEM;
 
-	memset(ring->txd, 0, pc->sz_ring);
 	ring->rxd = &ring->txd[MTK_DMA_SIZE];
 	ring->rphys = ring->tphys + MTK_DMA_SIZE * sizeof(*ring->txd);
 	ring->cur_tptr = 0;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ