summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2018-10-10 17:08:19 +0200
committerChristoph Hellwig <hch@lst.de>2018-10-17 08:58:30 +0200
commit202359c007f6b1d6247a062c0682d6d5bcd3e7d7 (patch)
tree65dbfcc35ad0ed809118f34f5af7a916893e5ed5 /drivers/nvme
parentnvmet-fc: fix kernel-doc headers (diff)
downloadlinux-202359c007f6b1d6247a062c0682d6d5bcd3e7d7.tar.xz
linux-202359c007f6b1d6247a062c0682d6d5bcd3e7d7.zip
nvme-core: make implicit seed truncation explicit
The nvme_user_io.slba field is 64 bits wide. That value is copied into the 32-bit bio_integrity_payload.bip_iter.bi_sector field. Make that truncation explicit to avoid that Coverity complains about implicit truncation. See also Coverity ID 1056486 on http://scan.coverity.com/projects/linux. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8cecb36b5af1..65c42448e904 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1132,7 +1132,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
return nvme_submit_user_cmd(ns->queue, &c,
(void __user *)(uintptr_t)io.addr, length,
- metadata, meta_len, io.slba, NULL, 0);
+ metadata, meta_len, lower_32_bits(io.slba), NULL, 0);
}
static u32 nvme_known_admin_effects(u8 opcode)