]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/block/nvme: fix endian conversion
authorKlaus Jensen <k.jensen@samsung.com>
Mon, 24 Aug 2020 09:55:46 +0000 (11:55 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 27 Oct 2020 06:24:46 +0000 (07:24 +0100)
commitfd90f26cc732b5c0f51140ba0d1f7fd31e8bf910
tree578d8b270945f9994a5fd79b2472aa49ab49343c
parent9994f72bd8c379eda01503ef6a7b06b7900110c5
hw/block/nvme: fix endian conversion

The raw NLB field is a 16 bit value, so use le16_to_cpu instead of
le32_to_cpu and cast to uint32_t before incrementing the value to not
wrap around.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/block/nvme.c