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:   Mon, 15 May 2017 21:14:08 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        kernel-janitors@...r.kernel.org
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/6] PNP: Improve a size determination in pnp_alloc_dev()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 15 May 2017 19:45:23 +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/pnp/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 27945a2d9c4e..6ccec10aed11 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -141,7 +141,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id,
 	struct pnp_dev *dev;
 	struct pnp_id *dev_id;
 
-	dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev)
 		return NULL;
 
-- 
2.13.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ