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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54BBC536.5010006@users.sourceforge.net>
Date:	Sun, 18 Jan 2015 15:37:42 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Don Brace <don.brace@...s.com>, iss_storagedev@...com,
	storagedev@...s.com, linux-scsi@...r.kernel.org
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 1/3] block-cciss: Deletion of an unnecessary check before
 the function call "put_disk"

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 18 Jan 2015 11:14:16 +0100

The put_disk() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/block/cciss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index ff20f19..4be0de0 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -4424,8 +4424,7 @@ static void free_hba(ctlr_info_t *h)
 
 	hba[h->ctlr] = NULL;
 	for (i = 0; i < h->highest_lun + 1; i++)
-		if (h->gendisk[i] != NULL)
-			put_disk(h->gendisk[i]);
+		put_disk(h->gendisk[i]);
 	kfree(h);
 }
 
-- 
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ