瀏覽代碼

jbd: Deletion of an unnecessary check 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>
Markus Elfring 10 年之前
父節點
當前提交
11cc9f56a1
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      fs/jbd/journal.c

+ 1 - 2
fs/jbd/journal.c

@@ -1373,8 +1373,7 @@ int journal_destroy(journal_t *journal)
 	}
 	}
 	mutex_unlock(&journal->j_checkpoint_mutex);
 	mutex_unlock(&journal->j_checkpoint_mutex);
 
 
-	if (journal->j_inode)
-		iput(journal->j_inode);
+	iput(journal->j_inode);
 	if (journal->j_revoke)
 	if (journal->j_revoke)
 		journal_destroy_revoke(journal);
 		journal_destroy_revoke(journal);
 	kfree(journal->j_wbuf);
 	kfree(journal->j_wbuf);