diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-31 11:11:58 -0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2016-02-12 08:58:07 +0100 |
commit | b48d054283a2c2d60a100bf7772bf308042c57ac (patch) | |
tree | 2773776fac072ef771aa296bf5ea00f1ddb7d865 | |
parent | 237c785fe583ca5838d5389d38c8f3050c276861 (diff) | |
download | lwn-b48d054283a2c2d60a100bf7772bf308042c57ac.tar.gz lwn-b48d054283a2c2d60a100bf7772bf308042c57ac.zip |
xhci: fix placement of call to usb_disabled()
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@canonical.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | drivers/usb/host/xhci.c | 6 |
1 files 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(); |