From 250fb892d3915f81a04f4eee2f8abe2e88718faa Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Wed, 30 Jan 2013 07:48:43 +0000 Subject: [PATCH] Add missing NULL pointer check. Reported by: Lars Engels MFC after: 1 week --- sys/dev/usb/controller/xhci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index c62f7815eaf..2a06ea2cfb9 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *sc, struct xhci_trb *trb) * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF("short TD has no " + "alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr ||