Skip to content

Commit 0d454e4

Browse files
elfringjankara
authored andcommitted
udf: Deletion of unnecessary checks before the function call "iput"
The iput() 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@users.sourceforge.net> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 11cc9f5 commit 0d454e4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/udf/super.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,8 +2237,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
22372237
return 0;
22382238

22392239
error_out:
2240-
if (sbi->s_vat_inode)
2241-
iput(sbi->s_vat_inode);
2240+
iput(sbi->s_vat_inode);
22422241
#ifdef CONFIG_UDF_NLS
22432242
if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
22442243
unload_nls(sbi->s_nls_map);
@@ -2291,8 +2290,7 @@ static void udf_put_super(struct super_block *sb)
22912290

22922291
sbi = UDF_SB(sb);
22932292

2294-
if (sbi->s_vat_inode)
2295-
iput(sbi->s_vat_inode);
2293+
iput(sbi->s_vat_inode);
22962294
#ifdef CONFIG_UDF_NLS
22972295
if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
22982296
unload_nls(sbi->s_nls_map);

0 commit comments

Comments
 (0)