From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP8fe-0003Yc-IB for qemu-devel@nongnu.org; Fri, 29 Jan 2016 08:01:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP8fa-0005la-8J for qemu-devel@nongnu.org; Fri, 29 Jan 2016 08:01:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP8fa-0005lO-30 for qemu-devel@nongnu.org; Fri, 29 Jan 2016 08:00:58 -0500 From: P J P Date: Fri, 29 Jan 2016 18:30:34 +0530 Message-Id: <1454072434-16045-1-git-send-email-ppandit@redhat.com> Subject: [Qemu-devel] [PATCH] usb: ehci: add capability mmio write function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Zuozhi Fzz , Gerd Hoffmann , Prasad J Pandit From: Prasad J Pandit 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 Signed-off-by: Prasad J Pandit --- 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 c40013e..b08ff62 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -893,6 +893,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) { @@ -2313,6 +2318,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, -- 2.5.0