]> git.ipfire.org Git - thirdparty/qemu.git/commit
esp.c: only call dma_memory_read function if transfer length is non-zero
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 11 Jul 2025 20:46:33 +0000 (21:46 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 14 Jul 2025 22:25:10 +0000 (00:25 +0200)
commit9d6df740ec5e43bd8e4521901aca95f9780e524a
tree50489316ac8341eaec2c944d754c28080dbf530b
parente70aa5dc299c49c59bd91c80e771db56996c2188
esp.c: only call dma_memory_read function if transfer length is non-zero

In the cases where mixed DMA/non-DMA transfers are used or no data is
available, it is possible for the calculated transfer length to be zero.
Only call the dma_memory_read function where the transfer length is
non-zero to avoid invoking the DMA engine for a zero length transfer
which can have side-effects (along with generating additional tracing
noise).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250711204636.542964-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/scsi/esp.c