Skip to contentSkip to conversation

ipc: mqueue: remove unnecessary conditionals

PATCH Applied Jingyu Wang 2 participants 2 messages Sep 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipc: mqueue: remove unnecessary conditionals

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

---
 ipc/mqueue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
ipc/mqueue.c +1 -2
index 9cf314b3f079..467a194b8a2e 100644
@@ -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

Signature · 1 line
2.34.1