Skip to content

Commit 4590ed7

Browse files
matnymangregkh
authored andcommitted
xhci: fix finding correct bus_state structure for USB 3.1 hosts
commit 5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c upstream. xhci driver keeps a bus_state structure for each hcd (usb2 and usb3) The structure is picked based on hcd speed, but driver only compared for HCD_USB3 speed, returning the wrong bus_state for HCD_USB31 hosts. This caused null pointer dereference errors in bus_resume function. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 13713e6 commit 4590ed7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/usb/host/xhci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ struct xhci_bus_state {
14901490

14911491
static inline unsigned int hcd_index(struct usb_hcd *hcd)
14921492
{
1493-
if (hcd->speed == HCD_USB3)
1493+
if (hcd->speed >= HCD_USB3)
14941494
return 0;
14951495
else
14961496
return 1;

0 commit comments

Comments
 (0)