From: Markus Armbruster Date: Thu, 10 Jan 2013 13:33:23 +0000 (+0100) Subject: ehci: Assert state machine is sane w.r.t. EHCIQueue X-Git-Tag: v1.4.0-rc0~192^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cc8d2b65c7e5f44172bf3ec300407522162e9a7f;p=users%2Fdwmw2%2Fqemu.git 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 Signed-off-by: Gerd Hoffmann --- 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;