summaryrefslogtreecommitdiff
path: root/fs/ksmbd
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-08-02 02:14:03 +0300
committerNamjae Jeon <namjae.jeon@samsung.com>2021-08-02 02:17:25 +0300
commit8b99f3504b688e3b55380521b6bf68c3d0c485d6 (patch)
treeb5298038003f1db833ddf59e474c3f65d40b56d9 /fs/ksmbd
parentf1abdb78a1080a49deac6e91e1675525d1d3dfbe (diff)
downloadlinux-8b99f3504b688e3b55380521b6bf68c3d0c485d6.tar.xz
ksmbd: fix an oops in error handling in smb2_open()
If smb2_get_name() then name is an error pointer. In the clean up code, we try to kfree() it and that will lead to an Oops. Set it to NULL instead. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd')
-rw-r--r--fs/ksmbd/smb2pdu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index 209e32e61a75..636570ecfa31 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -2462,6 +2462,7 @@ int smb2_open(struct ksmbd_work *work)
rc = PTR_ERR(name);
if (rc != -ENOMEM)
rc = -ENOENT;
+ name = NULL;
goto err_out1;
}