]>
Commit | Line | Data |
---|---|---|
b0bd2087 GKH |
1 | From 5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c Mon Sep 17 00:00:00 2001 |
2 | From: Mathias Nyman <mathias.nyman@linux.intel.com> | |
3 | Date: Mon, 18 Sep 2017 17:39:13 +0300 | |
4 | Subject: xhci: fix finding correct bus_state structure for USB 3.1 hosts | |
5 | ||
6 | From: Mathias Nyman <mathias.nyman@linux.intel.com> | |
7 | ||
8 | commit 5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c upstream. | |
9 | ||
10 | xhci driver keeps a bus_state structure for each hcd (usb2 and usb3) | |
11 | ||
12 | The structure is picked based on hcd speed, but driver only compared | |
13 | for HCD_USB3 speed, returning the wrong bus_state for HCD_USB31 hosts. | |
14 | ||
15 | This caused null pointer dereference errors in bus_resume function. | |
16 | ||
17 | Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> | |
18 | Signed-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; |