Skip to content

Commit 20b135e

Browse files
Dan CarpenterSteve French
authored andcommitted
cifs: Fix an error pointer dereference in cifs_mount()
The error handling calls kfree(full_path) so we can't let it be a NULL pointer. There used to be a NULL assignment here but we accidentally deleted it. Add it back. Fixes: 7efd081 ("cifs: document and cleanup dfs mount") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
1 parent 327a8d7 commit 20b135e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4886,6 +4886,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol)
48864886
full_path = build_unc_path_to_root(vol, cifs_sb, !!count);
48874887
if (IS_ERR(full_path)) {
48884888
rc = PTR_ERR(full_path);
4889+
full_path = NULL;
48894890
break;
48904891
}
48914892
/* Chase referral */

0 commit comments

Comments
 (0)