[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 78/81] scsi: mptsas: fix the wrong reading size in f
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 78/81] scsi: mptsas: fix the wrong reading size in fetch request |
Date: |
Mon, 20 Mar 2017 18:08:42 -0500 |
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>
(cherry picked from commit b01a2d07c963e96dbd151f0db1eaa06f273acf34)
Signed-off-by: Michael Roth <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 ad87e78..421955b 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) {
--
2.7.4
- [Qemu-devel] [PATCH 69/81] target-i386: correctly propagate retaddr into SVM helpers, (continued)
- [Qemu-devel] [PATCH 69/81] target-i386: correctly propagate retaddr into SVM helpers, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 08/81] 9pfs: local: llistxattr: don't follow symlinks, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 61/81] block/nfs: fix NULL pointer dereference in URI parsing, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 05/81] 9pfs: local: keep a file descriptor on the shared folder, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 64/81] vnc: do not disconnect on EAGAIN, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 63/81] sd: sdhci: check data length during dma_memory_read, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 76/81] NetRxPkt: Account buffer with ETH header in IOV length, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 66/81] block/vmdk: Fix the endian problem of buf_len and lba, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 73/81] eth: Extend vlan stripping functions, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 77/81] e1000e: correctly tear down MSI-X memory regions, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 78/81] scsi: mptsas: fix the wrong reading size in fetch request,
Michael Roth <=
- [Qemu-devel] [PATCH 81/81] thread-pool: add missing qemu_bh_cancel in completion function, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 71/81] hmp: fix block_set_io_throttle, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 72/81] cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo (CVE-2017-2620), Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 80/81] s390x/css: reassign subchannel if schid is changed after migration, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 79/81] virtio-pci: reset modern vq meta data, Michael Roth, 2017/03/20
- [Qemu-devel] [PATCH 07/81] 9pfs: local: lgetxattr: don't follow symlinks, Michael Roth, 2017/03/20
- Re: [Qemu-devel] [PATCH 00/81] Patch Round-up for stable 2.8.1, freeze on 2017-03-27, Eric Blake, 2017/03/20
- Re: [Qemu-devel] [PATCH 00/81] Patch Round-up for stable 2.8.1, freeze on 2017-03-27, Richard Henderson, 2017/03/20
- Re: [Qemu-devel] [Qemu-stable] [PATCH 00/81] Patch Round-up for stable 2.8.1, freeze on 2017-03-27, Greg Kurz, 2017/03/21