From: Mathias Nyman Date: Mon, 18 Sep 2017 14:39:13 +0000 (+0300) Subject: xhci: fix finding correct bus_state structure for USB 3.1 hosts X-Git-Tag: v4.14-rc4~33^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a838a13c9b4e5dd188b7a6eaeb894e9358ead0c;p=platform%2Fkernel%2Flinux-rpi.git xhci: fix finding correct bus_state structure for USB 3.1 hosts 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. Cc: Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 2abaa4d..e96e90d 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1681,7 +1681,7 @@ struct xhci_bus_state { static inline unsigned int hcd_index(struct usb_hcd *hcd) { - if (hcd->speed == HCD_USB3) + if (hcd->speed >= HCD_USB3) return 0; else return 1;