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:16:04 +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 3/6] PNP: Improve a size determination in
 pnp_clone_dependent_set()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 15 May 2017 19:52:26 +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/quirks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index d28e3ab9479c..215a50723243 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -155,6 +155,5 @@ static struct pnp_option *pnp_clone_dependent_set(struct pnp_dev *dev,
 	list_for_each_entry(option, &dev->options, list) {
 		if (pnp_option_is_dependent(option) &&
 		    pnp_option_set(option) == set) {
-			new_option = kmalloc(sizeof(struct pnp_option),
-					     GFP_KERNEL);
+			new_option = kmalloc(sizeof(*new_option), GFP_KERNEL);
 			if (!new_option) {
-- 
2.13.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ