Commit a2ba2709 authored by Dan Carpenter's avatar Dan Carpenter Committed by Steve French

cifsd: Fix a use after free on error path

The ksmbd_free_work_struct() frees "work" so we need to swap the order
of these two function calls to avoid a use after free.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 8ef32967
......@@ -638,8 +638,8 @@ static void __smb2_oplock_break_noti(struct work_struct *wk)
if (allocate_oplock_break_buf(work)) {
ksmbd_err("smb2_allocate_rsp_buf failed! ");
atomic_dec(&conn->r_count);
ksmbd_free_work_struct(work);
ksmbd_fd_put(work, fp);
ksmbd_free_work_struct(work);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment