[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220908190239.76888-1-jingyuwang_vip@163.com>
Date: Fri, 9 Sep 2022 03:02:39 +0800
From: Jingyu Wang <jingyuwang_vip@....com>
To: mic@...ikod.net, paul@...l-moore.com, jmorris@...ei.org,
serge@...lyn.com
Cc: linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, Jingyu Wang <jingyuwang_vip@....com>
Subject: [PATCH] landlock: Remove unnecessary conditionals
iput() has already handled null and non-null parameter, so it is no
need to use if().
Signed-off-by: Jingyu Wang <jingyuwang_vip@....com>
---
security/landlock/fs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/security/landlock/fs.c b/security/landlock/fs.c
index 6121e9834961..3d0a8a418ce4 100644
--- a/security/landlock/fs.c
+++ b/security/landlock/fs.c
@@ -1009,8 +1009,7 @@ static void hook_sb_delete(struct super_block *const sb)
spin_unlock(&sb->s_inode_list_lock);
/* Puts the inode reference from the last loop walk, if any. */
- if (prev_inode)
- iput(prev_inode);
+ iput(prev_inode);
/* Waits for pending iput() in release_inode(). */
wait_var_event(&landlock_superblock(sb)->inode_refs,
!atomic_long_read(&landlock_superblock(sb)->inode_refs));
base-commit: 5957ac6635a1a12d4aa2661bbf04d3085a73372a
--
2.34.1
Powered by blists - more mailing lists