Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexandru M Stan and committed by
Greg Kroah-Hartman
7b813767 6070636c

+1 -1
+1 -1
drivers/usb/dwc2/hcd.c
··· 2824 2824 list_move_tail(&chan->split_order_list_entry, 2825 2825 &hsotg->split_order); 2826 2826 2827 - if (hsotg->params.host_dma) { 2827 + if (hsotg->params.host_dma && chan->qh) { 2828 2828 if (hsotg->params.dma_desc_enable) { 2829 2829 if (!chan->xfer_started || 2830 2830 chan->ep_type == USB_ENDPOINT_XFER_ISOC) {