lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <42c711b8-2c96-4538-8415-f6fd82d080d1@web.de>
Date: Sat, 11 Oct 2025 13:29:01 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
 Bharath SM <bharathsm@...rosoft.com>, Paulo Alcantara <pc@...guebit.org>,
 Ronnie Sahlberg <ronniesahlberg@...il.com>,
 Sachin Prabhu <sprabhu@...hat.com>, Shyam Prasad N <sprasad@...rosoft.com>,
 Steve French <sfrench@...ba.org>, Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Xiaoli Feng <xifeng@...hat.com>
Subject: [PATCH] smb: client: Delete an unnecessary check before iput() in
 cifs_do_create()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 11 Oct 2025 13:20:10 +0200

It can be known that the function “iput” performs a null pointer check
for its input parameter.
It is therefore not needed to repeat such a check before its call.

Thus remove a redundant pointer check.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/smb/client/dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c
index 694c362740a9..27dd20003976 100644
--- a/fs/smb/client/dir.c
+++ b/fs/smb/client/dir.c
@@ -450,8 +450,8 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned
 out_err:
 	if (server->ops->close)
 		server->ops->close(xid, tcon, fid);
-	if (newinode)
-		iput(newinode);
+
+	iput(newinode);
 	goto out;
 }
 
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ