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>] [day] [month] [year] [list]
Date:   Wed, 24 Aug 2016 17:57:27 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-arm-kernel@...ts.infradead.org,
        Russell King <linux@...linux.org.uk>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>,
        Joe Perches <joe@...ches.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: [PATCH] ARM: plat-pxa: Use kmalloc_array() in pxa_dma_init_debugfs()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 24 Aug 2016 17:45:51 +0200

A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kmalloc_array".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/arm/plat-pxa/dma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c
index de2b061..50aa995 100644
--- a/arch/arm/plat-pxa/dma.c
+++ b/arch/arm/plat-pxa/dma.c
@@ -237,8 +237,9 @@ static void pxa_dma_init_debugfs(void)
 	if (!dbgfs_state)
 		goto err_state;
 
-	dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels,
-			     GFP_KERNEL);
+	dbgfs_chan = kmalloc_array(num_dma_channels,
+				   sizeof(*dbgfs_state),
+				   GFP_KERNEL);
 	if (!dbgfs_chan)
 		goto err_alloc;
 
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ