[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/18] scsi: mptsas: fix the wrong reading size in fe
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 10/18] scsi: mptsas: fix the wrong reading size in fetch request |
Date: |
Tue, 14 Mar 2017 17:18:12 +0100 |
From: Li Qiang <address@hidden>
When fetching request, it should read sizeof(*hdr), not the
pointer hdr.
Signed-off-by: Li Qiang <address@hidden>
Message-Id: <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/mptsas.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index 2e091c0..765ab53 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -756,7 +756,7 @@ static void mptsas_fetch_request(MPTSASState *s)
/* Read the message header from the guest first. */
addr = s->host_mfa_high_addr | MPTSAS_FIFO_GET(s, request_post);
- pci_dma_read(pci, addr, req, sizeof(hdr));
+ pci_dma_read(pci, addr, req, sizeof(*hdr));
if (hdr->Function < ARRAY_SIZE(mpi_request_sizes) &&
mpi_request_sizes[hdr->Function]) {
@@ -766,8 +766,8 @@ static void mptsas_fetch_request(MPTSASState *s)
*/
size = mpi_request_sizes[hdr->Function];
assert(size <= MPTSAS_MAX_REQUEST_SIZE);
- pci_dma_read(pci, addr + sizeof(hdr), &req[sizeof(hdr)],
- size - sizeof(hdr));
+ pci_dma_read(pci, addr + sizeof(*hdr), &req[sizeof(*hdr)],
+ size - sizeof(*hdr));
}
if (hdr->Function == MPI_FUNCTION_SCSI_IO_REQUEST) {
--
1.8.3.1
- [Qemu-devel] [PULL 08/18] configure: add the missing help output for optional features, (continued)
- [Qemu-devel] [PULL 08/18] configure: add the missing help output for optional features, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 07/18] scripts/dump-guest-memory.py: fix int128_get64 on recent gcc, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 09/18] util: Removed unneeded header from path.c, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 12/18] qemu-timer: fix off-by-one, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 13/18] qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 14/18] cpus: define QEMUTimerListNotifyCB for QEMU system emulation, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 16/18] icount: process QEMU_CLOCK_VIRTUAL timers in vCPU thread, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 18/18] nbd/client: fix drop_sync [CVE-2017-2630], Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 11/18] target/nios2: take BQL around interrupt check, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 10/18] scsi: mptsas: fix the wrong reading size in fetch request,
Paolo Bonzini <=
- [Qemu-devel] [PULL 17/18] memory: info mtree check mr range overflow, Paolo Bonzini, 2017/03/14
- [Qemu-devel] [PULL 15/18] main-loop: remove now unnecessary optimization, Paolo Bonzini, 2017/03/14
- Re: [Qemu-devel] [PULL 00/18] Misc patches for QEMU 2.9 hard freeze, Peter Maydell, 2017/03/14