Skip to content

Commit

Permalink
ksmbd: fix an oops in error handling in smb2_open()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
Dan Carpenter authored and namjaejeon committed Jul 29, 2021
1 parent d54a48e commit 4a12b06
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4a12b06

Please sign in to comment.