Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] smb: client: Improve exception handling in smb2_setup_async_request()
@ 2025-10-09 11:52 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-10-09 11:52 UTC (permalink / raw)
  To: linux-cifs, samba-technical, Bharath SM, Enzo Matsumiya,
	Paulo Alcantara, Pavel Shilovsky, Ronnie Sahlberg, Shyam Prasad N,
	Steve French, Tom Talpey
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 9 Oct 2025 13:40:46 +0200

Add a label so that a bit of exception handling can be better reused
from an if branch in this function implementation.

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

diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c
index bc0e92eb2b64..02ebd1f4ae7a 100644
--- a/fs/smb/client/smb2transport.c
+++ b/fs/smb/client/smb2transport.c
@@ -921,14 +921,15 @@ smb2_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst)
 
 	mid = smb2_mid_entry_alloc(shdr, server);
 	if (mid == NULL) {
-		revert_current_mid_from_hdr(server, shdr);
-		return ERR_PTR(-ENOMEM);
+		rc = -ENOMEM;
+		goto revert_current_mid_from_hdr;
 	}
 
 	rc = smb2_sign_rqst(rqst, server);
 	if (rc) {
-		revert_current_mid_from_hdr(server, shdr);
 		release_mid(mid);
+revert_current_mid_from_hdr:
+		revert_current_mid_from_hdr(server, shdr);
 		return ERR_PTR(rc);
 	}
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-09 11:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 11:52 [PATCH] smb: client: Improve exception handling in smb2_setup_async_request() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox