Commit 25349e82 authored by Klaus Birkelund Jensen's avatar Klaus Birkelund Jensen Committed by Kevin Wolf
Browse files

nvme: fix copy direction in DMA reads going to CMB



`nvme_dma_read_prp` erronously used `qemu_iovec_*to*_buf` instead of
`qemu_iovec_*from*_buf` when the request involved the controller memory
buffer.

Signed-off-by: default avatarKlaus Birkelund Jensen <klaus.jensen@cnexlabs.com>
Reviewed-by: default avatarKenneth Heitke <kenneth.heitke@intel.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 832d78ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
        }
        qemu_sglist_destroy(&qsg);
    } else {
        if (unlikely(qemu_iovec_to_buf(&iov, 0, ptr, len) != len)) {
        if (unlikely(qemu_iovec_from_buf(&iov, 0, ptr, len) != len)) {
            trace_nvme_err_invalid_dma();
            status = NVME_INVALID_FIELD | NVME_DNR;
        }