usb/ohci: Fix crash with when specifying too many num-ports
commita1f006fe937bcbb163f4759eae865d6515239128
authorThomas Huth <thuth@redhat.com>
Mon, 23 May 2016 09:23:07 +0000 (23 11:23 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 4 Aug 2016 21:43:40 +0000 (4 16:43 -0500)
treefb6f679a6000ca31289a7f09a511accb59fddd70
parentcba9a8042fb9f887c191e26826d6b236bae53c03
usb/ohci: Fix crash with when specifying too many num-ports

QEMU currently crashes when an OHCI controller is instantiated with
too many ports, e.g. "-device pci-ohci,num-ports=100,masterbus=1".
Thus add a proper check in usb_ohci_init() to make sure that we
do not use more than OHCI_MAX_PORTS = 15 ports here.

Ticket: https://bugs.launchpad.net/qemu/+bug/1581308
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 1463995387-11710-1-git-send-email-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit d400fc018b326104d26d730e5cc8c36c1f662c34)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/usb/hcd-ohci.c