aboutsummaryrefslogtreecommitdiff
path: root/hw/nvme
diff options
context:
space:
mode:
authorKlaus Jensen <k.jensen@samsung.com>2024-02-08 13:22:48 +0100
committerKlaus Jensen <k.jensen@samsung.com>2024-03-12 15:48:56 +0100
commit8c78015a55d84c016da6d5e41b6b5f618ecb25ab (patch)
treed476565068b98bbfd7169e041f0ae722a4c9ce00 /hw/nvme
parent4f0a4a3d5854824e5c5eccf353d4a1f4f749a29d (diff)
downloadqemu-8c78015a55d84c016da6d5e41b6b5f618ecb25ab.zip
qemu-8c78015a55d84c016da6d5e41b6b5f618ecb25ab.tar.gz
qemu-8c78015a55d84c016da6d5e41b6b5f618ecb25ab.tar.bz2
hw/nvme: fix invalid check on mcl
The number of logical blocks within a source range is converted into a 1s based number at the time of parsing. However, when verifying the copy length we add one again, causing the check against MCL to fail in error. Cc: qemu-stable@nongnu.org Fixes: 381ab99d8587 ("hw/nvme: check maximum copy length (MCL) for COPY") Reviewed-by: Minwoo Im <minwoo.im@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/nvme')
-rw-r--r--hw/nvme/ctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 94ef639..abc0387 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -2855,7 +2855,7 @@ static inline uint16_t nvme_check_copy_mcl(NvmeNamespace *ns,
uint32_t nlb;
nvme_copy_source_range_parse(iocb->ranges, idx, iocb->format, NULL,
&nlb, NULL, NULL, NULL);
- copy_len += nlb + 1;
+ copy_len += nlb;
}
if (copy_len > ns->id_ns.mcl) {