提交 bac04454 编写于 作者: E Elad Grupi 提交者: Christoph Hellwig

nvmet-tcp: fix kmap leak when data digest in use

When data digest is enabled we should unmap pdu iovec before handling
the data digest pdu.
Signed-off-by: NElad Grupi <elad.grupi@dell.com>
Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 d218a8a3
...@@ -1098,11 +1098,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue) ...@@ -1098,11 +1098,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue)
cmd->rbytes_done += ret; cmd->rbytes_done += ret;
} }
nvmet_tcp_unmap_pdu_iovec(cmd);
if (queue->data_digest) { if (queue->data_digest) {
nvmet_tcp_prep_recv_ddgst(cmd); nvmet_tcp_prep_recv_ddgst(cmd);
return 0; return 0;
} }
nvmet_tcp_unmap_pdu_iovec(cmd);
if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) && if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
cmd->rbytes_done == cmd->req.transfer_len) { cmd->rbytes_done == cmd->req.transfer_len) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册