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:   Sat, 1 Oct 2016 16:53:10 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-raid@...r.kernel.org, Guoqing Jiang <gqjiang@...e.com>,
        Shaohua Li <shli@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 08/15] md-cluster: Improve determination of sizes in
 read_resync_info()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 1 Oct 2016 12:52:58 +0200

Replace the specification of data structures by either a pointer
dereference or a variable name 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/md/md-cluster.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index e965e78..0918108 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -275,10 +275,10 @@ static struct suspend_info *read_resync_info(struct mddev *mddev, struct dlm_loc
 	sector_t hi = 0;
 
 	dlm_lock_sync(lockres, DLM_LOCK_CR);
-	memcpy(&ri, lockres->lksb.sb_lvbptr, sizeof(struct resync_info));
+	memcpy(&ri, lockres->lksb.sb_lvbptr, sizeof(ri));
 	hi = le64_to_cpu(ri.hi);
 	if (hi > 0) {
-		s = kzalloc(sizeof(struct suspend_info), GFP_KERNEL);
+		s = kzalloc(sizeof(*s), GFP_KERNEL);
 		if (!s)
 			goto out;
 		s->hi = hi;
-- 
2.10.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ