Skip to content

Commit

Permalink
cifs: Fix an error pointer dereference in cifs_mount()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Steve French committed Aug 7, 2020
1 parent 327a8d7 commit 20b135e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -4886,6 +4886,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *vol)
full_path = build_unc_path_to_root(vol, cifs_sb, !!count);
if (IS_ERR(full_path)) {
rc = PTR_ERR(full_path);
full_path = NULL;
break;
}
/* Chase referral */
Expand Down

0 comments on commit 20b135e

Please sign in to comment.