smb: client: Avoid redundant statements after a failed kmalloc() in SMB2_sess_auth_rawntlmssp_negotiate()
Subsystems (3)
PATCH 1/1 smb: client: Avoid redundant statements after a failed kmalloc() in SMB2_sess_auth_rawntlmssp_negotiate()
From: Markus Elfring <[email protected]>
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 <[email protected]>
--- fs/smb/client/smb2pdu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/smb/client/smb2pdu.c +2 -1
@@ -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 ; }
Signature · 1 line
2.51.0