]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.13.6/xhci-fix-finding-correct-bus_state-structure-for-usb-3.1-hosts.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.13.6 / xhci-fix-finding-correct-bus_state-structure-for-usb-3.1-hosts.patch
CommitLineData
b0bd2087
GKH
1From 5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c Mon Sep 17 00:00:00 2001
2From: Mathias Nyman <mathias.nyman@linux.intel.com>
3Date: Mon, 18 Sep 2017 17:39:13 +0300
4Subject: xhci: fix finding correct bus_state structure for USB 3.1 hosts
5
6From: Mathias Nyman <mathias.nyman@linux.intel.com>
7
8commit 5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c upstream.
9
10xhci driver keeps a bus_state structure for each hcd (usb2 and usb3)
11
12The structure is picked based on hcd speed, but driver only compared
13for HCD_USB3 speed, returning the wrong bus_state for HCD_USB31 hosts.
14
15This caused null pointer dereference errors in bus_resume function.
16
17Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/usb/host/xhci.h | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24--- a/drivers/usb/host/xhci.h
25+++ b/drivers/usb/host/xhci.h
26@@ -1674,7 +1674,7 @@ struct xhci_bus_state {
27
28 static inline unsigned int hcd_index(struct usb_hcd *hcd)
29 {
30- if (hcd->speed == HCD_USB3)
31+ if (hcd->speed >= HCD_USB3)
32 return 0;
33 else
34 return 1;