ehci: fix queue->dev null ptr dereference
PATCH 1/1 ehci: fix queue->dev null ptr dereference
In case we don't have a device for an active queue, just skip processing the queue (same we do for inactive queues) and log a guest bug.
Reported-by Guenter Roeck <[email protected]>
Signed-off-by Gerd Hoffmann <[email protected]>
Tested-by Guenter Roeck <[email protected]>
--- hw/usb/hcd-ehci.c | 3 +++ 1 file changed, 3 insertions(+)
hw/usb/hcd-ehci.c +3 -0
@@ -1834,6 +1834,9 @@ static int ehci_state_fetchqtd(EHCIQueue *q)ehci_set_state (q->ehci, q->async,EST_EXECUTING );break ; } + }else if (q->dev ==NULL ) { +ehci_trace_guest_bug (q->ehci,"no device attached to queue" ); +ehci_set_state (q->ehci, q->async,EST_HORIZONTALQH ); }else { p =ehci_alloc_packet (q); p->qtdaddr = q->qtdaddr;
Signature · 1 line
2.18.1