From 5ab47a4a465dcd765088ff020762eefba97f85c1 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Fri, 13 Apr 2018 17:56:00 +0800 Subject: FROMLIST: usb: dwc2: Fix NULL qh in dwc2_queue_transaction When a usb device disconnects in a certain way, dwc2_queue_transaction still gets called after dwc2_hcd_cleanup_channels. dwc2_hcd_cleanup_channels does "channel->qh = NULL;" but dwc2_queue_transaction still wants to dereference qh. This adds a check for a null qh. (am from https://patchwork.kernel.org/patch/7245251/) Change-Id: Ia9c7f5febe0bb6f0123cfc85c90beb9fc1d80bdd Signed-off-by: Alexandru M Stan Signed-off-by: Meng Dongyang --- drivers/usb/dwc2/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 505444cf7a8f..c407172e3ffb 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -2857,7 +2857,7 @@ static int dwc2_queue_transaction(struct dwc2_hsotg *hsotg, list_move_tail(&chan->split_order_list_entry, &hsotg->split_order); - if (hsotg->core_params->dma_enable > 0) { + if (hsotg->core_params->dma_enable > 0 && chan->qh) { if (hsotg->core_params->dma_desc_enable > 0) { if (!chan->xfer_started || chan->ep_type == USB_ENDPOINT_XFER_ISOC) { -- cgit v1.2.3