The caller of 'megasas_map_sgl' will only check if the return
is zero or not. If it return 0 it means success, as in the next
patch we will consider 'iov_count=0' is an error, so let's
return -1 to indicate a failure.
Signed-off-by: Li Qiang <[email protected]>
Message-Id: <
20200815141940[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
if (iov_count > MEGASAS_MAX_SGE) {
trace_megasas_iovec_sgl_overflow(cmd->index, iov_count,
MEGASAS_MAX_SGE);
- return iov_count;
+ return -1;
}
pci_dma_sglist_init(&cmd->qsg, PCI_DEVICE(s), iov_count);
for (i = 0; i < iov_count; i++) {
return 0;
unmap:
qemu_sglist_destroy(&cmd->qsg);
- return iov_count - i;
+ return -1;
}
/*