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:   Sun, 15 Oct 2017 22:09:39 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     kernel-janitors@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/3] char/bsr: Improve a size determination in bsr_add_node()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 15 Oct 2017 21:25:46 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/char/bsr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 865eb457e539..d0597dfa4d88 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -197,8 +197,7 @@ static int bsr_add_node(struct device_node *bn)
 	num_bsr_devs = bsr_bytes_len / sizeof(u32);
 
 	for (i = 0 ; i < num_bsr_devs; i++) {
-		struct bsr_dev *cur = kzalloc(sizeof(struct bsr_dev),
-					      GFP_KERNEL);
+		struct bsr_dev *cur = kzalloc(sizeof(*cur), GFP_KERNEL);
 		struct resource res;
 		int result;
 
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ