Return-Path: Received: from mga07.intel.com ([134.134.136.100]:55156 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbdIROfn (ORCPT ); Mon, 18 Sep 2017 10:35:43 -0400 From: Mathias Nyman To: Cc: , Mathias Nyman , Subject: [PATCH 2/8] xhci: fix finding correct bus_state structure for USB 3.1 hosts Date: Mon, 18 Sep 2017 17:39:13 +0300 Message-Id: <1505745559-749-3-git-send-email-mathias.nyman@linux.intel.com> In-Reply-To: <1505745559-749-1-git-send-email-mathias.nyman@linux.intel.com> References: <1505745559-749-1-git-send-email-mathias.nyman@linux.intel.com> Sender: stable-owner@vger.kernel.org List-ID: 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 --- drivers/usb/host/xhci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 1.9.1