Skip to content

Commit b6229b7

Browse files
Dan Carpentergregkh
authored andcommitted
cifs: unlock on error in smb3_reconfigure()
[ Upstream commit cda88d2 ] Unlock before returning if smb3_sync_session_ctx_passwords() fails. Fixes: 7e654ab ("cifs: during remount, make sure passwords are in sync") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Bharath SM <[email protected]> Signed-off-by: Steve French <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0e41457 commit b6229b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/smb/client/fs_context.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,10 @@ static int smb3_reconfigure(struct fs_context *fc)
978978
* later stage
979979
*/
980980
rc = smb3_sync_session_ctx_passwords(cifs_sb, ses);
981-
if (rc)
981+
if (rc) {
982+
mutex_unlock(&ses->session_mutex);
982983
return rc;
984+
}
983985

984986
/*
985987
* now that allocations for passwords are done, commit them

0 commit comments

Comments
 (0)