]> git.hungrycats.org Git - linux/commitdiff
cifs: unlock on error in smb3_reconfigure()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 15 Nov 2024 09:13:58 +0000 (12:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:32 +0000 (13:54 +0100)
[ 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 <dan.carpenter@linaro.org>
Reviewed-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/fs_context.c

index e84660b48d533e7208df684ece5b2e750d2a0299..e9fe48a3625baef7c670f186c0ef44852d355ab2 100644 (file)
@@ -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