Skip to content

Commit d25ac7a

Browse files
committed
Fix for DWC OTG HCD URB Dequeue has NULL URB panic. Thanks Naren
1 parent e026371 commit d25ac7a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,12 @@ static int urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
761761
dump_urb_info(urb, "urb_dequeue");
762762
}
763763
#endif
764-
dwc_otg_hcd_urb_dequeue(dwc_otg_hcd, (dwc_otg_hcd_urb_t *)urb->hcpriv);
764+
if(urb->hcpriv != NULL) {
765+
dwc_otg_hcd_urb_dequeue(dwc_otg_hcd, (dwc_otg_hcd_urb_t *)urb->hcpriv);
765766

766-
dwc_free(urb->hcpriv);
767-
urb->hcpriv = NULL;
767+
urb->hcpriv = NULL;
768+
dwc_free(urb->hcpriv);
769+
}
768770

769771
/* Higher layer software sets URB status. */
770772
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))

0 commit comments

Comments
 (0)