提交 2a7f2630 编写于 作者: G Gerd Hoffmann

ehci: add sanity check for maxframes

Reported-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Message-id: 20170703111549.10924-1-kraxel@redhat.com
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 6e2c4633
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册