[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5ab09bf1-b71b-4c7d-9836-e75416db2446@web.de>
Date: Thu, 9 Oct 2025 11:05:25 +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>,
Pavel Shilovsky <pshilov@...rosoft.com>,
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
Subject: [PATCH] smb: client: Avoid redundant statements after a failed
kmalloc() in SMB2_sess_auth_rawntlmssp_negotiate()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 9 Oct 2025 10:55:16 +0200
Use an additional label so that statements (which are not useful after
a failed kmalloc() call) can be skipped in this function implementation.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
fs/smb/client/smb2pdu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 42e2d4ea344d..ff83d672aa05 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -1724,7 +1724,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data)
ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL);
if (!ses->ntlmssp) {
rc = -ENOMEM;
- goto out_err;
+ goto out_set_result;
}
ses->ntlmssp->sesskey_per_smbsess = true;
@@ -1793,6 +1793,7 @@ SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data)
out_err:
kfree_sensitive(ses->ntlmssp);
ses->ntlmssp = NULL;
+out_set_result:
sess_data->result = rc;
sess_data->func = NULL;
}
--
2.51.0
Powered by blists - more mailing lists