smb: client: Improve exception handling in smb2_setup_request()
Subsystems (3)
PATCH 1/1 smb: client: Improve exception handling in smb2_setup_request()
From: Markus Elfring <[email protected]>
Date: Thu, 9 Oct 2025 16:24:17 +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 <[email protected]>
--- fs/smb/client/smb2transport.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
fs/smb/client/smb2transport.c +4 -5
@@ -886,15 +886,14 @@ smb2_setup_request(struct cifs_ses *ses, struct TCP_Server_Info *server,smb2_seq_num_into_buf (server, shdr); rc =smb2_get_mid_entry (ses, server, shdr, &mid); -if (rc) { -revert_current_mid_from_hdr (server, shdr); -return ERR_PTR (rc); - } +if (rc) + goto revert_current_mid_from_hdr; rc =smb2_sign_rqst (rqst, server);if (rc) { -revert_current_mid_from_hdr (server, shdr);delete_mid (mid); +revert_current_mid_from_hdr: +revert_current_mid_from_hdr (server, shdr);return ERR_PTR (rc); }
Signature · 1 line
2.51.0