summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-17 17:54:17 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-17 17:54:17 +0100
commitca4e667dbf431d4a2a5a619cde79d30dd2ac3eb2 (patch)
treec8da577bcc1fd9c63be46332e4c2c7abe2d1dc43
parentdf55c7e8c81db4b142ee157bc41d2ba401b8db20 (diff)
parent2a7f2630684ee556a394a354d64159a4470c0151 (diff)
downloadfocaccia-qemu-ca4e667dbf431d4a2a5a619cde79d30dd2ac3eb2.tar.gz
focaccia-qemu-ca4e667dbf431d4a2a5a619cde79d30dd2ac3eb2.zip
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20170717-pull-request' into staging
ehci fix for 2.10

# gpg: Signature made Mon 17 Jul 2017 10:40:00 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20170717-pull-request:
  ehci: add sanity check for maxframes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/usb/hcd-ehci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 73090e01ad..604912cb3e 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2483,6 +2483,11 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp)
                    NB_PORTS);
         return;
     }
+    if (s->maxframes < 8 || s->maxframes > 512)  {
+        error_setg(errp, "maxframes %d out if range (8 .. 512)",
+                   s->maxframes);
+        return;
+    }
 
     usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ?
                 &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev);