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: <8d0079ed2b260a00bcaa906729325a4e8de66486.1540782140.git.post@steffenvogel.de>
Date:   Mon, 29 Oct 2018 04:03:40 +0100
From:   Steffen Vogel <post@...ffenvogel.de>
To:     linux-kernel@...r.kernel.org
Cc:     Evgeniy Polyakov <zbr@...emap.net>, Joe Perches <joe@...ches.com>,
        Steffen Vogel <post@...ffenvogel.de>
Subject: [PATCH v2 10/12] w1: use pointers instead of types to determine size of allocs

Get size of allocation based on pointer not type.

Signed-off-by: Steffen Vogel <post@...ffenvogel.de>
---
 drivers/w1/w1.c     | 2 +-
 drivers/w1/w1_int.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 4cbe1849fbfc..87094d99ccbe 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -756,7 +756,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
 	int err;
 	struct w1_netlink_msg msg;
 
-	sl = kzalloc(sizeof(struct w1_slave), GFP_KERNEL);
+	sl = kzalloc(sizeof(*sl), GFP_KERNEL);
 	if (!sl)
 		return -ENOMEM;
 
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index a5230c0d49e3..2bf7631ac24f 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -31,7 +31,7 @@ static struct w1_master *w1_alloc_dev(u32 id, int slave_count, int slave_ttl,
 	/*
 	 * We are in process context(kernel thread), so can sleep.
 	 */
-	dev = kzalloc(sizeof(struct w1_master) +
+	dev = kzalloc(sizeof(*dev) +
 		sizeof(struct w1_bus_master), GFP_KERNEL);
 	if (!dev)
 		return NULL;
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ