diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-07-18 13:29:08 +1000 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-07-20 13:31:09 +0200 |
commit | f81bb347ef80e94204b719e1d5e827babb556220 (patch) | |
tree | 3494801562c5adc2faf9f3f6c575c00694b31317 /hw/usb/hcd-xhci.c | |
parent | 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d (diff) |
xhci: Fix possible side effect from assert()
A static analysis tool called BEAM detected possible side effect from
assert() calling a helper which may change an XHCI ring after every call.
This moves xhci_ring_fetch() out of assert() so it will be called
with and without enabled debug.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1468812548-31868-1-git-send-email-aik@ozlabs.ru
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-xhci.c')
-rw-r--r-- | hw/usb/hcd-xhci.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 976bfb0659..188f95416a 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2201,7 +2201,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, xfer->trb_count = length; for (i = 0; i < length; i++) { - assert(xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL)); + TRBType type; + type = xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL); + assert(type); } xfer->streamid = streamid; |