From: Dan Carpenter Date: Fri, 15 Nov 2024 09:13:58 +0000 (+0300) Subject: cifs: unlock on error in smb3_reconfigure() X-Git-Tag: v6.11.11~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff46e1d444e8e6105c2b6d3268096d90a31b0a1;p=thirdparty%2Fkernel%2Fstable.git cifs: unlock on error in smb3_reconfigure() [ Upstream commit cda88d2fef7aa7de80b5697e8009fcbbb436f42d ] Unlock before returning if smb3_sync_session_ctx_passwords() fails. Fixes: 7e654ab7da03 ("cifs: during remount, make sure passwords are in sync") Signed-off-by: Dan Carpenter Reviewed-by: Bharath SM Signed-off-by: Steve French Signed-off-by: Sasha Levin --- diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index e84660b48d533..e9fe48a3625ba 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -978,8 +978,10 @@ static int smb3_reconfigure(struct fs_context *fc) * later stage */ rc = smb3_sync_session_ctx_passwords(cifs_sb, ses); - if (rc) + if (rc) { + mutex_unlock(&ses->session_mutex); return rc; + } /* * now that allocations for passwords are done, commit them