* [Qemu-devel] [PATCH] ehci: add sanity check for maxframes
@ 2017-07-03 11:15 Gerd Hoffmann
2017-07-03 11:32 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2017-07-03 11:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Gerd Hoffmann
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-ehci.c | 5 +++++
1 file changed, 5 insertions(+)
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);
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] ehci: add sanity check for maxframes
2017-07-03 11:15 [Qemu-devel] [PATCH] ehci: add sanity check for maxframes Gerd Hoffmann
@ 2017-07-03 11:32 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2017-07-03 11:32 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 3 July 2017 at 12:15, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/usb/hcd-ehci.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> 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);
Typo: should be "of".
> + return;
> + }
>
> usb_bus_new(&s->bus, sizeof(s->bus), s->companion_enable ?
> &ehci_bus_ops_companion : &ehci_bus_ops_standalone, dev);
> --
> 2.9.3
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Do we want something similar for hcd-uhci just for consistency?
thanks
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-03 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 11:15 [Qemu-devel] [PATCH] ehci: add sanity check for maxframes Gerd Hoffmann
2017-07-03 11:32 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).