diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2019-10-23 19:35:39 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-04 20:56:41 +0300 |
commit | e0bace71779d602e419a2f3b35f3bff2cfc638a3 (patch) | |
tree | 5f4ab4b7168802ba0ca6f0ba5ea524b5038df632 /drivers/nvme | |
parent | e08f2ae850929d40e66268ee47e443e7ea56eeb7 (diff) | |
download | linux-e0bace71779d602e419a2f3b35f3bff2cfc638a3.tar.xz |
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/tcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index d535080b781f..1e2d92f818ad 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -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; u32 len = le32_to_cpu(sgl->length); - if (!cmd->req.data_len) + if (!len) return 0; if (sgl->type == ((NVME_SGL_FMT_DATA_DESC << 4) | |