summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMeng Dongyang <daniel.meng@rock-chips.com>2018-04-13 17:56:00 +0800
committerTao Huang <huangtao@rock-chips.com>2018-04-17 09:31:07 +0800
commit5ab47a4a465dcd765088ff020762eefba97f85c1 (patch)
tree3b87fa891bdb7f768617c0955918a9d047f35f61 /drivers
parentd26d7a61c488252494e1605e0298afb3d2af7737 (diff)
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 <amstan@chromium.org> Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc2/hcd.c2
1 files changed, 1 insertions, 1 deletions
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) {