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: <20220819081927.96413-1-chi.minghao@zte.com.cn>
Date:   Fri, 19 Aug 2022 08:19:27 +0000
From:   cgel.zte@...il.com
To:     chi.minghao@....com.cn
Cc:     linux-kernel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: [PATCH] fs/isofs: delete unnecessary checks before brelse()

From: Minghao Chi <chi.minghao@....com.cn>

The brelse() function tests whether its argument is NULL
and then returns immediately.
Thus remove the tests which are not needed around the shown calls.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
 fs/isofs/dir.c    | 3 +--
 fs/isofs/export.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index eb2f8273e6f1..e90fc2d87bb4 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -236,8 +236,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
 		}
 		ctx->pos += de_len;
 	}
-	if (bh)
-		brelse(bh);
+	brelse(bh);
 	return 0;
 }
 
diff --git a/fs/isofs/export.c b/fs/isofs/export.c
index 35768a63fb1d..11bf964f4886 100644
--- a/fs/isofs/export.c
+++ b/fs/isofs/export.c
@@ -102,8 +102,7 @@ static struct dentry *isofs_export_get_parent(struct dentry *child)
 	rv = d_obtain_alias(isofs_iget(child_inode->i_sb, parent_block,
 				     parent_offset));
  out:
-	if (bh)
-		brelse(bh);
+	brelse(bh);
 	return rv;
 }
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ