* [PATCH] ipc: mqueue: remove unnecessary conditionals
@ 2022-09-08 18:54 Jingyu Wang
2022-09-08 20:04 ` Roman Gushchin
0 siblings, 1 reply; 2+ messages in thread
From: Jingyu Wang @ 2022-09-08 18:54 UTC (permalink / raw)
To: akpm, ebiederm, roman.gushchin, hbh25y, legion, longman, songmuchun
Cc: linux-kernel, Jingyu Wang
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>
---
ipc/mqueue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9cf314b3f079..467a194b8a2e 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -986,8 +986,7 @@ SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
out_unlock:
inode_unlock(d_inode(mnt->mnt_root));
- if (inode)
- iput(inode);
+ iput(inode);
mnt_drop_write(mnt);
out_name:
putname(name);
base-commit: 5957ac6635a1a12d4aa2661bbf04d3085a73372a
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ipc: mqueue: remove unnecessary conditionals
2022-09-08 18:54 [PATCH] ipc: mqueue: remove unnecessary conditionals Jingyu Wang
@ 2022-09-08 20:04 ` Roman Gushchin
0 siblings, 0 replies; 2+ messages in thread
From: Roman Gushchin @ 2022-09-08 20:04 UTC (permalink / raw)
To: Jingyu Wang
Cc: akpm, ebiederm, hbh25y, legion, longman, songmuchun, linux-kernel
On Fri, Sep 09, 2022 at 02:54:52AM +0800, Jingyu Wang wrote:
> 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>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-08 20:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 18:54 [PATCH] ipc: mqueue: remove unnecessary conditionals Jingyu Wang
2022-09-08 20:04 ` Roman Gushchin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).