[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/6] hw/ide/macio: Fix segfault caused by NULL DMACo
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 1/6] hw/ide/macio: Fix segfault caused by NULL DMAContext* |
Date: |
Mon, 26 Nov 2012 19:55:52 +0100 |
From: Peter Maydell <address@hidden>
Pass qemu_sglist_init the global dma_context_memory rather than a NULL
pointer; this fixes a segfault in dma_memory_map() when the guest
starts using DMA.
Reported-by: Amadeusz Sławiński <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ide/macio.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 720af6e..d2edcc0 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -76,7 +76,8 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
s->io_buffer_size = io->len;
- qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+ qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+ &dma_context_memory);
qemu_sglist_add(&s->sg, io->addr, io->len);
io->addr += io->len;
io->len = 0;
@@ -132,7 +133,8 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
s->io_buffer_index = 0;
s->io_buffer_size = io->len;
- qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+ qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+ &dma_context_memory);
qemu_sglist_add(&s->sg, io->addr, io->len);
io->addr += io->len;
io->len = 0;
--
1.6.0.2
- [Qemu-devel] [PULL 1.3 0/6] ppc 1.3 patch queue 2012-11-26, Alexander Graf, 2012/11/26
- [Qemu-devel] [PATCH 3/6] kvm: fix incorrect length in a loop over kvm dirty pages map, Alexander Graf, 2012/11/26
- [Qemu-devel] [PATCH 1/6] hw/ide/macio: Fix segfault caused by NULL DMAContext*,
Alexander Graf <=
- [Qemu-devel] [PATCH 6/6] fbdev: fix pixman compile on old pixman, Alexander Graf, 2012/11/26
- [Qemu-devel] [PATCH 4/6] pseries: Fix bug in PCI MSI allocation, Alexander Graf, 2012/11/26
- [Qemu-devel] [PATCH 2/6] PPC: Fix missing TRACE exception, Alexander Graf, 2012/11/26
- [Qemu-devel] [PATCH 5/6] vl.c: Fix broken -usb option, Alexander Graf, 2012/11/26
- Re: [Qemu-devel] [PULL 1.3 0/6] ppc 1.3 patch queue 2012-11-26, Anthony Liguori, 2012/11/28