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]
Date:   Tue, 6 Nov 2018 20:07:24 +0800
From:   kbuild test robot <fengguang.wu@...el.com>
To:     Maxime Jourdan <mjourdan@...libre.com>
Cc:     kbuild-all@...org, Mauro Carvalho Chehab <mchehab@...nel.org>,
        Hans Verkuil <hans.verkuil@...co.com>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Neil Armstrong <narmstrong@...libre.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org
Subject: [PATCH] media: meson: fix zalloc-simple.cocci warnings

From: kbuild test robot <fengguang.wu@...el.com>

drivers/media/platform/meson/vdec/esparser.c:148:13-31: WARNING: dma_zalloc_coherent should be used for eos_vaddr, instead of dma_alloc_coherent/memset


 Use zeroing allocator rather than allocator followed by memset with 0

 This considers some simple cases that are common and easy to validate
 Note in particular that there are no ...s in the rule, so all of the
 matched code has to be contiguous

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

Fixes: 3ab8ea56b2f6 ("media: meson: add v4l2 m2m video decoder driver")
CC: Maxime Jourdan <mjourdan@...libre.com>
Signed-off-by: kbuild test robot <fengguang.wu@...el.com>
---

url:    https://github.com/0day-ci/linux/commits/Maxime-Jourdan/dt-bindings-media-add-Amlogic-Video-Decoder-Bindings/20181106-162646
base:   git://linuxtv.org/media_tree.git master

Please take the patch only if it's a positive warning. Thanks!

 esparser.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/media/platform/meson/vdec/esparser.c
+++ b/drivers/media/platform/meson/vdec/esparser.c
@@ -145,13 +145,11 @@ int esparser_queue_eos(struct amvdec_cor
 	dma_addr_t eos_paddr;
 	int ret;
 
-	eos_vaddr = dma_alloc_coherent(dev,
-				       len + SEARCH_PATTERN_LEN,
-				       &eos_paddr, GFP_KERNEL);
+	eos_vaddr = dma_zalloc_coherent(dev, len + SEARCH_PATTERN_LEN,
+					&eos_paddr, GFP_KERNEL);
 	if (!eos_vaddr)
 		return -ENOMEM;
 
-	memset(eos_vaddr, 0, len + SEARCH_PATTERN_LEN);
 	memcpy(eos_vaddr, data, len);
 	ret = esparser_write_data(core, eos_paddr, len);
 	dma_free_coherent(dev, len + SEARCH_PATTERN_LEN,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ