[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] ehci: Assert state machine is sane w.r.t. EHCIQ
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 4/6] ehci: Assert state machine is sane w.r.t. EHCIQueue |
Date: |
Mon, 14 Jan 2013 12:50:17 +0100 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 320b7e7..7040659 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;
--
1.7.9.7
- [Qemu-devel] [PULL 0/6] usb patch queue, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 3/6] xhci: nuke transfe5rs on detach, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 1/6] xhci: create xhci_detach_slot helper function, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 5/6] usb-host: Drop superfluous null test from usb_host_auto_scan(), Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 6/6] usb-host: Initialize dev->port the obviously safe way, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 4/6] ehci: Assert state machine is sane w.r.t. EHCIQueue,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 2/6] xhci: call xhci_detach_slot on root port detach too, Gerd Hoffmann, 2013/01/14
- Re: [Qemu-devel] [PULL 0/6] usb patch queue, Anthony Liguori, 2013/01/14