summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/hcd.c
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2019-10-23 14:06:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-15 10:39:20 +0100
commit7b8137676457d99181fb2952f0b996b8569e6420 (patch)
treeae331e607caf94c851071cc352516b53bd083fc1 /drivers/usb/dwc2/hcd.c
parent6070636c4918c3c06e54edecdb323c8b57116768 (diff)
downloadblackbird-op-linux-7b8137676457d99181fb2952f0b996b8569e6420.tar.gz
blackbird-op-linux-7b8137676457d99181fb2952f0b996b8569e6420.zip
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. Acked-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Alexandru M Stan <amstan@chromium.org> [dianders: rebased to mainline] Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/hcd.c')
-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 81afe553aa66..b90f858af960 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -2824,7 +2824,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) {
OpenPOWER on IntegriCloud