]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: fix null pointer dereference in stop command timeout function
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 7 Sep 2016 14:26:33 +0000 (17:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2016 06:39:46 +0000 (08:39 +0200)
commit2c26498857774f4ef4bc4442e89b9cf5bde1e4a3
tree702e101c16910063d85580a74ed6645cbb8984f3
parent2719bb922019299aaf3880c72f3e26ccdc92175f
xhci: fix null pointer dereference in stop command timeout function

The stop endpoint command has its own 5 second timeout timer.
If the timeout function is triggered between USB3 and USB2 host
removal it will try to call usb_hc_died(xhci_to_hcd(xhci)->primary_hcd)

the ->primary_hcd will be set to NULL at USB3 hcd removal.

Fix this by first checking if the PCI host is being removed, and
also by using only xhci_to_hcd() as it will always return the primary
hcd.

CC: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c