isofs: delete unnecessary checks before brelse()
PATCH 1/1 isofs: delete unnecessary checks before brelse()
From: Minghao Chi <[email protected]>
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 <[email protected]>
Signed-off-by Minghao Chi <[email protected]>
--- fs/isofs/inode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
fs/isofs/inode.c +3 -6
@@ -1277,13 +1277,11 @@ static int isofs_read_level3_size(struct inode *inode) }while (more_entries); out:kfree (tmpde); -if (bh) -brelse (bh); +brelse (bh);return 0 ; out_nomem: -if (bh) -brelse (bh); +brelse (bh);return -ENOMEM ; out_noread:
@@ -1486,8 +1484,7 @@ static int isofs_read_inode(struct inode *inode, int relocated) ret =0 ; out:kfree (tmpde); -if (bh) -brelse (bh); +brelse (bh);return ret; out_badread:
Signature · 1 line
2.25.1
Jan Kara
maintainerQuoted 8 lines · On Fri 19-08-22 08:14:20, [email protected] wrote:
From: Minghao Chi <[email protected]>
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 <[email protected]>Signed-off-by Minghao Chi <[email protected]>
Thanks for the cleanup. I have added the patch to my tree.
Honza
Quoted 36 lines
--- fs/isofs/inode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)fs/isofs/inode.c +3
-6@@ -1277,13 +1277,11 @@ static int isofs_read_level3_size(struct inode *inode) }while (more_entries); out:kfree (tmpde); -if (bh) -brelse (bh); +brelse (bh);return 0 ; out_nomem: -if (bh) -brelse (bh); +brelse (bh);return -ENOMEM ; out_noread:@@ -1486,8 +1484,7 @@ static int isofs_read_inode(struct inode *inode, int relocated) ret =0 ; out:kfree (tmpde); -if (bh) -brelse (bh); +brelse (bh);return ret; out_badread:Signature · 1 line
2.25.1
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR