OSDN Git Service

hw/usb/hcd-ohci: Do not use PCI functions with sysbus devices in ohci_die()
authorThomas Huth <thuth@redhat.com>
Fri, 19 Apr 2019 07:56:24 +0000 (09:56 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 2 May 2019 06:42:17 +0000 (08:42 +0200)
commit72e0c127bd692660c087ba7fcbe9d50032c8debd
tree22a767f3d69c30cbd4b3102c619de300658a6cd8
parent0a076730adf469918d5d1cfdf9d740c6928208a4
hw/usb/hcd-ohci: Do not use PCI functions with sysbus devices in ohci_die()

The ohci_die() function always assumes to be running with a PCI OHCI
controller and calls the PCI-specific functions pci_set_word(). However,
this function might also get called for the sysbus OHCI devices, so it
likely fails in that case. To fix this issue, change the code now, so that
there are two implementations now, one for sysbus and one for PCI, and
use the right function via a function pointer in the OHCIState structure.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190419075625.24251-2-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ohci.c