mirror of https://gitee.com/openkylin/qemu.git
ehci: add sanity check for maxframes
Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20170703111549.10924-1-kraxel@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
6e2c463343
commit
2a7f263068
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue