[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454538786-12215-31-git-send-email-luis.henriques@canonical.com>
Date: Wed, 3 Feb 2016 22:30:36 +0000
From: Luis Henriques <luis.henriques@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Oliver Neukum <oneukum@...e.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Luis Henriques <luis.henriques@...onical.com>
Subject: [PATCH 3.16.y-ckt 030/180] xhci: refuse loading if nousb is used
3.16.7-ckt24 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Oliver Neukum <oneukum@...e.com>
commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
The module should fail to load.
Signed-off-by: Oliver Neukum <oneukum@...e.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
[ luis: backported to 3.16:
- moved usb_disabled() check to the top of the function so that there's
no need to invoke xhci_unregister_pci() before returning. Suggested
by gregkh. ]
Signed-off-by: Luis Henriques <luis.henriques@...onical.com>
---
drivers/usb/host/xhci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 20209e870a99..d9dd9264f813 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4928,6 +4928,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");
@@ -4955,6 +4958,7 @@ 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);
+
return 0;
unreg_pci:
xhci_unregister_pci();
Powered by blists - more mailing lists