]> www.infradead.org Git - users/willy/pagecache.git/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)
committerSteve French <stfrench@microsoft.com>
Thu, 28 Nov 2024 15:51:11 +0000 (09:51 -0600)
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>
fs/smb/client/fs_context.c

index c614c5d8b15e08c3100336d46c745d1b0bc47c73..49123f458d0c72e6e0a77223dfcc9e01180fbbc3 100644 (file)
@@ -1008,8 +1008,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