summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-03-31 17:00:08 +0200
committerSagi Grimberg <sagi@grimberg.me>2017-04-02 10:24:15 +0300
commit793c7ed9d785411a5cd6fe7e998cd7ee2870b38b (patch)
tree471509dbb132f277ce509c0f9dcf41b1c275fbe4 /drivers/nvme
parent78ce3daa7d703028c00eff2e03ad22efd116e549 (diff)
nvmet: fix byte swap in nvmet_parse_io_cmd
We need to do arithmetics after byte swapping, not before. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/io-cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c
index e37acd77b5fe..6b0baa9caab9 100644
--- a/drivers/nvme/target/io-cmd.c
+++ b/drivers/nvme/target/io-cmd.c
@@ -230,7 +230,7 @@ int nvmet_parse_io_cmd(struct nvmet_req *req)
return 0;
case nvme_cmd_dsm:
req->execute = nvmet_execute_dsm;
- req->data_len = le32_to_cpu(cmd->dsm.nr + 1) *
+ req->data_len = (le32_to_cpu(cmd->dsm.nr) + 1) *
sizeof(struct nvme_dsm_range);
return 0;
case nvme_cmd_write_zeroes: