From: Markus Elfring <elfr...@users.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 <elfr...@users.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to