All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jingyu Wang <jingyuwang_vip@163.com>
To: mic@digikod.net, paul@paul-moore.com, jmorris@namei.org,
	serge@hallyn.com
Cc: linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jingyu Wang <jingyuwang_vip@163.com>
Subject: [PATCH] landlock: Remove unnecessary conditionals
Date: Fri,  9 Sep 2022 03:02:39 +0800	[thread overview]
Message-ID: <20220908190239.76888-1-jingyuwang_vip@163.com> (raw)

iput() has already handled null and non-null parameter, so it is no
need to use if().

Signed-off-by: Jingyu Wang <jingyuwang_vip@163.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


             reply	other threads:[~2022-09-08 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 19:02 Jingyu Wang [this message]
2022-09-26 10:44 ` [PATCH] landlock: Remove unnecessary conditionals Mickaël Salaün

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220908190239.76888-1-jingyuwang_vip@163.com \
    --to=jingyuwang_vip@163.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.