From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbcIGGXz (ORCPT ); Wed, 7 Sep 2016 02:23:55 -0400 Received: from mga11.intel.com ([192.55.52.93]:64856 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079AbcIGGXx (ORCPT ); Wed, 7 Sep 2016 02:23:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,295,1470726000"; d="scan'208";a="5550238" From: Lu Baolu To: Mathias Nyman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Lu, Baolu" , stable@vger.kernel.org Subject: [PATCH 1/1] usb: xhci: fix return value of xhci_setup_device() Date: Wed, 7 Sep 2016 14:22:15 +0800 Message-Id: <1473229413-18064-1-git-send-email-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Lu, Baolu" xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted. Cc: stable@vger.kernel.org # 4.3+ Signed-off-by: Lu Baolu --- drivers/usb/host/xhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 01d96c9..3e66e73 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -3785,8 +3785,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, mutex_lock(&xhci->mutex); - if (xhci->xhc_state) /* dying, removing or halted */ + if (xhci->xhc_state) { /* dying, removing or halted */ + ret = -ESHUTDOWN; goto out; + } if (!udev->slot_id) { xhci_dbg_trace(xhci, trace_xhci_dbg_address, -- 2.1.4