From 95d721398cc7e800e67ad0133b9474df675ca3d1 Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Fri, 13 Apr 2018 17:56:00 +0800 Subject: [PATCH] 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(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 5e127848fd3c..1aad4765e5a5 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -3019,7 +3019,7 @@ static int dwc2_queue_transaction(struct dwc2_hsotg *hsotg, list_move_tail(&chan->split_order_list_entry, &hsotg->split_order); - if (hsotg->params.host_dma) { + if (hsotg->params.host_dma && chan->qh) { if (hsotg->params.dma_desc_enable) { if (!chan->xfer_started || chan->ep_type == USB_ENDPOINT_XFER_ISOC) {