From: Dan Carpenter Date: Sun, 1 Aug 2021 23:14:03 +0000 (+0900) Subject: ksmbd: fix an oops in error handling in smb2_open() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8b99f3504b688e3b55380521b6bf68c3d0c485d6;p=linux.git 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 Signed-off-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index 209e32e61a756..636570ecfa312 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; }