Re: [PATCH 3.12 20/64] xhci: refuse loading if nousb is used

From: Jiri Slaby
Date: Tue Feb 16 2016 - 03:49:27 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 02/16/2016, 04:06 AM, Ben Hutchings wrote:
> On Thu, 2016-02-11 at 14:58 +0100, Jiri Slaby wrote:
>> From: Oliver Neukum <oneukum@xxxxxxxx>
>>
>> 3.12-stable review patch. If anyone has any objections, please
>> let me know.
>>
>> ===============
>>
>> commit 1eaf35e4dd592c59041bc1ed3248c46326da1f5f upstream.
>>
>> The module should fail to load.
>>
>> Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx> Signed-off-by:
>> Jiri Slaby <jslaby@xxxxxxx> --- 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 47b25542a99c..6888e9a956d4 100644 ---
>> a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@
>> -4891,6 +4891,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();
>
> This check needs to go at the top of the function, before the call
> to xhci_register_pci().

Oh yes, this is done later in 3.12.54 in:

commit b48d054283a2c2d60a100bf7772bf308042c57ac
Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Sun Jan 31 11:11:58 2016 -0800

xhci: fix placement of call to usb_disabled()

thanks,
- --
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWwuKNAAoJEL0lsQQGtHBJijIP/iZ6yp7A99iQi2ZqPvsHe+xC
Cqip1AXpPaA727acGmlhC+B55jFzWQyEGFYOq7/Q3pZ8uxp9iVDfa6RsyfPqCbrF
ItadjVKhjTc4RW005sjqUJCh/7fg776tr7mcf+2vgrF/TexSi/OrOOOcgsBVp3vj
iZFnr2mKPC4nLhDx6iOIqYCSEGUASgdwQW3NuhnfOaVRM7lRBLl6Isbg24CN+Kra
V9/x1xxNl00eBpMEU6G9bav847KWdOLik6qW0emuy3Bjzc34bVRH74m20ZVcJSEI
5bG9BFGNbikQdasRoWr/H8OSnh1YwZ38daazPsIdDqyut4VKkQ5wfvxP+/c/KUsG
rYvfVTVaJWXb9gdODDleVIWRaZ1Va/0q5uzDrQi4KGV62dw9Pb0JJnDcuvWKmtx/
N0Fjjl7L1RoqNGklGPtqrYA2B8h/dqPlU0nOxwMBaafjeds+KK1k5ZWLlJUH3K4a
CAFeabEjVCaysrHZ768OXGAH/BGreAUTsYL4l5VapQZwy/EggV5oeFlJjkIRZDJG
kGQpGe63Bl/8+fFtx8UtW4d0LbtvgfSCIOZBCmyd/HIODODv53Exehm7vU409Dyd
9XsVJUhO/ANCHu/NSc+c9bL4f3u5Exd2uLoq2jeMricOZzat3ysVHFrTXqB1tO0f
D14IaCz004DOckjJzJQa
=Wtvm
-----END PGP SIGNATURE-----