mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
nvmet-tcp: Don't check data_len in nvmet_tcp_map_data()
None of the other transports check data_len which is verified in core code. The function should instead check that the sgl length is non-zero. Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
e08f2ae850
commit
e0bace7177
@ -320,7 +320,7 @@ static int nvmet_tcp_map_data(struct nvmet_tcp_cmd *cmd)
|
|||||||
struct nvme_sgl_desc *sgl = &cmd->req.cmd->common.dptr.sgl;
|
struct nvme_sgl_desc *sgl = &cmd->req.cmd->common.dptr.sgl;
|
||||||
u32 len = le32_to_cpu(sgl->length);
|
u32 len = le32_to_cpu(sgl->length);
|
||||||
|
|
||||||
if (!cmd->req.data_len)
|
if (!len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (sgl->type == ((NVME_SGL_FMT_DATA_DESC << 4) |
|
if (sgl->type == ((NVME_SGL_FMT_DATA_DESC << 4) |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user