Skip to content

Commit

Permalink
nvmet-tcp: fix inline data size comparison in nvmet_tcp_queue_response
Browse files Browse the repository at this point in the history
Using "<=" instead "<" to compare inline data size.

Fixes: bdaf132 ("nvmet-tcp: fix a segmentation fault during io parsing error")
Signed-off-by: Hou Pu <houpu.main@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Hou Pu authored and Christoph Hellwig committed May 26, 2021
1 parent 042a3ea commit 25df1ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/target/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ static void nvmet_tcp_queue_response(struct nvmet_req *req)
* nvmet_req_init is completed.
*/
if (queue->rcv_state == NVMET_TCP_RECV_PDU &&
len && len < cmd->req.port->inline_data_size &&
len && len <= cmd->req.port->inline_data_size &&
nvme_is_write(cmd->req.cmd))
return;
}
Expand Down

0 comments on commit 25df1ac

Please sign in to comment.