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>] [day] [month] [year] [list]
Message-ID: <d57685d8-d0ce-4a53-177f-a98d116d2981@web.de>
Date:   Tue, 3 Sep 2019 21:30:31 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     kernel-janitors@...r.kernel.org,
        Evgeniy Dushistov <dushistov@...l.ru>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] ufs: Delete an unnecessary check before brelse()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 3 Sep 2019 21:27:55 +0200

The brelse() 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>
---
 fs/ufs/super.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 1da0be667409..20799faa307a 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -574,8 +574,7 @@ static int ufs_read_cylinder_structures(struct super_block *sb)
 	kfree (base);
 	if (sbi->s_ucg) {
 		for (i = 0; i < uspi->s_ncg; i++)
-			if (sbi->s_ucg[i])
-				brelse (sbi->s_ucg[i]);
+			brelse(sbi->s_ucg[i]);
 		kfree (sbi->s_ucg);
 		for (i = 0; i < UFS_MAX_GROUP_LOADED; i++)
 			kfree (sbi->s_ucpi[i]);
--
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ