[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/57] hw: megasas: return -1 when 'megasas_map_sgl' fails
From: |
Paolo Bonzini |
Subject: |
[PULL 28/57] hw: megasas: return -1 when 'megasas_map_sgl' fails |
Date: |
Sat, 19 Sep 2020 11:58:47 -0400 |
From: Li Qiang <liq3ea@163.com>
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 <liq3ea@163.com>
Message-Id: <20200815141940.44025-2-liq3ea@163.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/megasas.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index e90c00823a..4cc709d2c6 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -280,7 +280,7 @@ static int megasas_map_sgl(MegasasState *s, MegasasCmd
*cmd, union mfi_sgl *sgl)
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++) {
@@ -310,7 +310,7 @@ static int megasas_map_sgl(MegasasState *s, MegasasCmd
*cmd, union mfi_sgl *sgl)
return 0;
unmap:
qemu_sglist_destroy(&cmd->qsg);
- return iov_count - i;
+ return -1;
}
/*
--
2.26.2
- [PULL 05/57] meson: fix MSI rule, (continued)
- [PULL 05/57] meson: fix MSI rule, Paolo Bonzini, 2020/09/19
- [PULL 08/57] configure: Do not intent to build WHPX on 32-bit host, Paolo Bonzini, 2020/09/19
- [PULL 09/57] MAINTAINERS: add Paolo Bonzini as RCU maintainer, Paolo Bonzini, 2020/09/19
- [PULL 16/57] doc: Cleanup "'-mem-path' fallback to RAM" deprecation text, Paolo Bonzini, 2020/09/19
- [PULL 12/57] vhost-scsi: support inflight io track, Paolo Bonzini, 2020/09/19
- [PULL 10/57] target/i386: support KVM_FEATURE_ASYNC_PF_INT, Paolo Bonzini, 2020/09/19
- [PULL 11/57] memory: Convert IOMMUMemoryRegionClass doc comment to kernel-doc, Paolo Bonzini, 2020/09/19
- [PULL 17/57] numa: remove fixup numa_state->num_nodes to MAX_NODES, Paolo Bonzini, 2020/09/19
- [PULL 23/57] hw/char/serial: Remove old DEBUG_SERIAL commented code, Paolo Bonzini, 2020/09/19
- [PULL 24/57] hw/char/serial: Rename I/O read/write trace events, Paolo Bonzini, 2020/09/19
- [PULL 28/57] hw: megasas: return -1 when 'megasas_map_sgl' fails,
Paolo Bonzini <=
- [PULL 19/57] hw/char/serial: Remove TYPE_SERIAL_IO, Paolo Bonzini, 2020/09/19
- [PULL 14/57] acpi: i386: Move VMBus DSDT entry to SB, Paolo Bonzini, 2020/09/19
- [PULL 13/57] Simplify the .gitignore file, Paolo Bonzini, 2020/09/19
- [PULL 15/57] numa: drop support for '-numa node' (without memory specified), Paolo Bonzini, 2020/09/19
- [PULL 26/57] hw/char/serial-{isa, pci}: Alias QDEV properties from generic serial object, Paolo Bonzini, 2020/09/19
- [PULL 29/57] hw: megasas: consider 'iov_count=0' is an error in megasas_map_sgl, Paolo Bonzini, 2020/09/19
- [PULL 31/57] meson: move libudev test, Paolo Bonzini, 2020/09/19
- [PULL 45/57] oslib-posix: relocate path to /var, Paolo Bonzini, 2020/09/19
- [PULL 21/57] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes, Paolo Bonzini, 2020/09/19
- [PULL 32/57] meson: move libmpathpersist test, Paolo Bonzini, 2020/09/19