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
commit 25df1ac upstream.

Using "<=" instead "<" to compare inline data size.

Fixes: bdaf132 ("nvmet-tcp: fix a segmentation fault during io parsing error")
Signed-off-by: Hou Pu <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
puhou authored and gregkh committed Jun 3, 2021
1 parent 2a4115d commit 981e08a
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 @@ -538,7 +538,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 981e08a

Please sign in to comment.