summaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ehci.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-10 14:33:23 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-01-14 12:47:11 +0100
commitcc8d2b65c7e5f44172bf3ec300407522162e9a7f (patch)
tree4b7667962a605a301bd5f5b87c0a77de3152c55e /hw/usb/hcd-ehci.c
parent0cb41e2c5ebc1f8fa180a1726981416fee9abad1 (diff)
downloadqemu-cc8d2b65c7e5f44172bf3ec300407522162e9a7f.tar.gz
ehci: Assert state machine is sane w.r.t. EHCIQueue
Coverity worries the EHCIQueue pointer could be null when we pass it to functions that reference it. The state machine ensures it can't be null then. Assert that, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci.c')
-rw-r--r--hw/usb/hcd-ehci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 320b7e7239..70406592ef 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2092,18 +2092,22 @@ static void ehci_advance_state(EHCIState *ehci, int async)
break;
case EST_ADVANCEQUEUE:
+ assert(q != NULL);
again = ehci_state_advqueue(q);
break;
case EST_FETCHQTD:
+ assert(q != NULL);
again = ehci_state_fetchqtd(q);
break;
case EST_HORIZONTALQH:
+ assert(q != NULL);
again = ehci_state_horizqh(q);
break;
case EST_EXECUTE:
+ assert(q != NULL);
again = ehci_state_execute(q);
if (async) {
ehci->async_stepdown = 0;