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: <18a48c67-962d-2e61-7d24-dc145ec90935@users.sourceforge.net>
Date:   Sat, 1 Oct 2016 09:44:40 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     dm-devel@...hat.com, linux-raid@...r.kernel.org,
        Alasdair Kergon <agk@...hat.com>,
        Mike Snitzer <snitzer@...hat.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 2/9] md/dm-table: Reduce the scope for a variable in
 dm_table_verify_integrity()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 1 Oct 2016 07:10:43 +0200

Move the definition for the variable "template_disk" into an if branch
so that an extra initialisation can be avoided at the beginning
by this refactoring.

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

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index f6b817c..73d38d0 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1391,14 +1391,13 @@ int dm_calculate_queue_limits(struct dm_table *table,
  */
 static void dm_table_verify_integrity(struct dm_table *t)
 {
-	struct gendisk *template_disk = NULL;
-
 	if (t->integrity_supported) {
 		/*
 		 * Verify that the original integrity profile
 		 * matches all the devices in this table.
 		 */
-		template_disk = dm_table_get_integrity_disk(t);
+		struct gendisk *template_disk = dm_table_get_integrity_disk(t);
+
 		if (template_disk &&
 		    blk_integrity_compare(dm_disk(t->md), template_disk) >= 0)
 			return;
-- 
2.10.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ