diff options
author | Oliver Neukum <oneukum@suse.com> | 2015-12-03 15:03:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-28 21:57:09 -0800 |
commit | 4e83609a7bad0bab9996b562ca1e0b5e0d17f8c7 (patch) | |
tree | 07ab84823eac07be604fec1877e993bab24fc5e9 | |
parent | dd50c9750b38e8b2cb6b40c2ebbcc14377540a7a (diff) | |
download | lwn-4e83609a7bad0bab9996b562ca1e0b5e0d17f8c7.tar.gz lwn-4e83609a7bad0bab9996b562ca1e0b5e0d17f8c7.zip |
xhci: refuse loading if nousb is used
commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
The module should fail to load.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/xhci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 596eccc1f6a8..c8e693c22014 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4893,6 +4893,10 @@ static int __init xhci_hcd_init(void) BUILD_BUG_ON(sizeof(struct xhci_intr_reg) != 8*32/8); /* 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(); |