[<prev] [next>] [day] [month] [year] [list]
Message-ID: <746d1756-5e07-412c-a142-985028bd954f@web.de>
Date: Thu, 9 Oct 2025 13:52:55 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
Bharath SM <bharathsm@...rosoft.com>, Enzo Matsumiya <ematsumiya@...e.de>,
Paulo Alcantara <pc@...guebit.org>, Pavel Shilovsky <pshilov@...rosoft.com>,
Ronnie Sahlberg <ronniesahlberg@...il.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: Improve exception handling in
smb2_setup_async_request()
From: Markus Elfring <elfring@...rs.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@...rs.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
Powered by blists - more mailing lists