From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahxjK-0006q1-8m for qemu-devel@nongnu.org; Mon, 21 Mar 2016 07:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahxjH-0001jQ-7N for qemu-devel@nongnu.org; Mon, 21 Mar 2016 07:10:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahxjH-0001jK-0I for qemu-devel@nongnu.org; Mon, 21 Mar 2016 07:10:35 -0400 From: Gerd Hoffmann Date: Mon, 21 Mar 2016 12:10:24 +0100 Message-Id: <1458558624-6890-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1458558624-6890-1-git-send-email-kraxel@redhat.com> References: <1458558624-6890-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 6/6] usb: ehci: add capability mmio write function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Prasad J Pandit , Gerd Hoffmann 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 Message-id: 1454072434-16045-1-git-send-email-ppandit@redhat.com Signed-off-by: Gerd Hoffmann --- 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