Commit be0f89d4 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: fix wrong error response status by using set_smb2_rsp_status()

set_smb2_rsp_status() after __process_request() sets the wrong error
status. This patch resets all iov vectors and sets the error status
on clean one.

Fixes: e2b76ab8 ("ksmbd: add support for read compound")
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent f4332835
...@@ -231,11 +231,12 @@ void set_smb2_rsp_status(struct ksmbd_work *work, __le32 err) ...@@ -231,11 +231,12 @@ void set_smb2_rsp_status(struct ksmbd_work *work, __le32 err)
{ {
struct smb2_hdr *rsp_hdr; struct smb2_hdr *rsp_hdr;
if (work->next_smb2_rcv_hdr_off) rsp_hdr = smb2_get_msg(work->response_buf);
rsp_hdr = ksmbd_resp_buf_next(work);
else
rsp_hdr = smb2_get_msg(work->response_buf);
rsp_hdr->Status = err; rsp_hdr->Status = err;
work->iov_idx = 0;
work->iov_cnt = 0;
work->next_smb2_rcv_hdr_off = 0;
smb2_set_err_rsp(work); smb2_set_err_rsp(work);
} }
......
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