[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e9a80fab15e323008608bb2648535325289b1d32.1455198893.git.jslaby@suse.cz>
Date: Thu, 11 Feb 2016 14:59:35 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 59/64] xhci: fix placement of call to usb_disabled()
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
In the backport of 1eaf35e4dd592c59041bc1ed3248c46326da1f5f, the call to
usb_disabled() was too late, after we had already done some allocation.
Move that call to the top of the function instead, making the logic
match what is intended and is in the original patch.
Reported-by: Luis Henriques <luis.henriques@...onical.com>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
drivers/usb/host/xhci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 6888e9a956d4..dfcf0a3527b8 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4864,6 +4864,9 @@ static int __init xhci_hcd_init(void)
{
int retval;
+ if (usb_disabled())
+ return -ENODEV;
+
retval = xhci_register_pci();
if (retval < 0) {
pr_debug("Problem registering PCI driver.\n");
@@ -4892,9 +4895,6 @@ static int __init xhci_hcd_init(void)
/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
- if (usb_disabled())
- return -ENODEV;
-
return 0;
unreg_pci:
xhci_unregister_pci();
--
2.7.1
Powered by blists - more mailing lists