[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/6] usb: ehci: add capability mmio write function
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 6/6] usb: ehci: add capability mmio write function |
Date: |
Mon, 21 Mar 2016 12:10:24 +0100 |
From: Prasad J Pandit <address@hidden>
USB Ehci emulation supports host controller capability registers.
But its mmio '.write' function was missing, which lead to a null
pointer dereference issue. Add a do nothing 'ehci_caps_write'
definition to avoid it; Do nothing because capability registers
are Read Only(RO).
Reported-by: Zuozhi Fzz <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 1b50601..0f95d0d 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -895,6 +895,11 @@ static uint64_t ehci_caps_read(void *ptr, hwaddr addr,
return s->caps[addr];
}
+static void ehci_caps_write(void *ptr, hwaddr addr,
+ uint64_t val, unsigned size)
+{
+}
+
static uint64_t ehci_opreg_read(void *ptr, hwaddr addr,
unsigned size)
{
@@ -2315,6 +2320,7 @@ static void ehci_frame_timer(void *opaque)
static const MemoryRegionOps ehci_mmio_caps_ops = {
.read = ehci_caps_read,
+ .write = ehci_caps_write,
.valid.min_access_size = 1,
.valid.max_access_size = 4,
.impl.min_access_size = 1,
--
1.8.3.1
- [Qemu-devel] [PULL 0/6] usb patch queue, Gerd Hoffmann, 2016/03/21
- [Qemu-devel] [PULL 3/6] usb: fix unbound stack usage for usb_mtp_add_str, Gerd Hoffmann, 2016/03/21
- [Qemu-devel] [PULL 4/6] usb: fix unbound stack warning for inotify_watchfn, Gerd Hoffmann, 2016/03/21
- [Qemu-devel] [PULL 5/6] hw/usb/dev-mtp: Guard inotify usage with CONFIG_INOTIFY1, Gerd Hoffmann, 2016/03/21
- [Qemu-devel] [PULL 1/6] usb: Fix compilation for Windows, Gerd Hoffmann, 2016/03/21
- [Qemu-devel] [PULL 6/6] usb: ehci: add capability mmio write function,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 2/6] usb: fix unbounded stack warning for xhci_dma_write_u32s, Gerd Hoffmann, 2016/03/21
- Re: [Qemu-devel] [PULL 0/6] usb patch queue, Peter Maydell, 2016/03/22