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  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, 26 Feb 2019 22:09:54 -0800
From:   Robert Eshleman <bobbyeshleman@...il.com>
To:     bobbyeshleman@...il.com
Cc:     Tariq Toukan <tariqt@...lanox.com>,
        "David S. Miller" <davem@...emloft.net>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 7/8] net: seeq: replace kmalloc / memset(,0) with kzalloc

This patch reduces a call to memset(,0) by replacing
a kmalloc call with a kzalloc call.

Signed-off-by: Robert Eshleman <bobbyeshleman@...il.com>
---
 drivers/net/ethernet/seeq/ether3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index d1bb73bf9914..7456cf08a48f 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -223,7 +223,7 @@ ether3_addr(char *addr, struct expansion_card *ec)
 static int
 ether3_ramtest(struct net_device *dev, unsigned char byte)
 {
-	unsigned char *buffer = kmalloc(RX_END, GFP_KERNEL);
+	unsigned char *buffer = kzalloc(RX_END, GFP_KERNEL);
 	int i,ret = 0;
 	int max_errors = 4;
 	int bad = -1;
@@ -231,7 +231,6 @@ ether3_ramtest(struct net_device *dev, unsigned char byte)
 	if (!buffer)
 		return 1;
 
-	memset(buffer, byte, RX_END);
 	ether3_setbuffer(dev, buffer_write, 0);
 	ether3_writebuffer(dev, buffer, TX_END);
 	ether3_setbuffer(dev, buffer_write, RX_START);
-- 
2.20.1

Powered by blists - more mailing lists