[PATCH 1/3] smb: client: Return directly after a failed cifs_alloc_hash() in smb3_crypto_shash_allocate()

Markus Elfring posted 3 patches 2 months, 1 week ago
[PATCH 1/3] smb: client: Return directly after a failed cifs_alloc_hash() in smb3_crypto_shash_allocate()
Posted by Markus Elfring 2 months, 1 week ago
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 9 Oct 2025 18:44:53 +0200

Return directly after a call of the function “cifs_alloc_hash” failed
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/smb/client/smb2transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c
index bc0e92eb2b64..499b00c2a001 100644
--- a/fs/smb/client/smb2transport.c
+++ b/fs/smb/client/smb2transport.c
@@ -34,7 +34,7 @@ smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
 
 	rc = cifs_alloc_hash("hmac(sha256)", &p->hmacsha256);
 	if (rc)
-		goto err;
+		return rc;
 
 	rc = cifs_alloc_hash("cmac(aes)", &p->aes_cmac);
 	if (rc)
-- 
2.51.0