aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-08-05 12:52:07 +0300
committerSteve French <stfrench@microsoft.com>2020-08-06 22:06:10 -0500
commit20b135e48cdda7a7dfccef7286def66e5c9686c3 (patch)
tree708ca016a0346701a0b47d583eb2bc583039372c /fs/cifs
parentMerge tag '5.9-rc-smb3-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 (diff)
downloadlinux-dev-20b135e48cdda7a7dfccef7286def66e5c9686c3.tar.xz
linux-dev-20b135e48cdda7a7dfccef7286def66e5c9686c3.zip
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: 7efd08158261 ("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>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7e3e5e2098eb..2fe6b1ab75c3 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -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 */