Commit bac04454 authored by Elad Grupi's avatar Elad Grupi Committed by Christoph Hellwig
Browse files

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: default avatarElad Grupi <elad.grupi@dell.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent d218a8a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1098,11 +1098,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue)
		cmd->rbytes_done += ret;
	}

	nvmet_tcp_unmap_pdu_iovec(cmd);
	if (queue->data_digest) {
		nvmet_tcp_prep_recv_ddgst(cmd);
		return 0;
	}
	nvmet_tcp_unmap_pdu_iovec(cmd);

	if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
	    cmd->rbytes_done == cmd->req.transfer_len) {