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: <529972b2-5251-4cb5-e5cb-70de6628fe71@users.sourceforge.net>
Date:   Thu, 6 Oct 2016 11:31:11 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-raid@...r.kernel.org, Christoph Hellwig <hch@....de>,
        Guoqing Jiang <gqjiang@...e.com>, Jens Axboe <axboe@...com>,
        Mike Christie <mchristi@...hat.com>,
        Neil Brown <neilb@...e.com>, Shaohua Li <shli@...nel.org>,
        Tomasz Majchrzak <tomasz.majchrzak@...el.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 31/54] md/raid5: Adjust two function calls together with a
 variable assignment

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 5 Oct 2016 10:00:07 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/md/raid5.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ef180c0..a37f1f9 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -501,11 +501,10 @@ static int grow_buffers(struct stripe_head *sh, gfp_t gfp)
 	int num = sh->raid_conf->pool_size;
 
 	for (i = 0; i < num; i++) {
-		struct page *page;
+		struct page *page = alloc_page(gfp);
 
-		if (!(page = alloc_page(gfp))) {
+		if (!page)
 			return 1;
-		}
 		sh->dev[i].page = page;
 		sh->dev[i].orig_page = page;
 	}
@@ -6525,8 +6524,8 @@ static struct r5conf *setup_conf(struct mddev *mddev)
 		goto free_conf;
 
 	conf->mddev = mddev;
-
-	if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL)
+	conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL);
+	if (!conf->stripe_hashtbl)
 		goto free_conf;
 
 	/* We init hash_locks[0] separately to that it can be used
-- 
2.10.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ