xhci: don't dereference a xhci member after removing xhci
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 16 Aug 2016 07:18:06 +0000 (10:18 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:01:33 +0000 (01:01 +0000)
commita9d438ce4d098d5924338053eed443f4e5036c97
tree5369438e8e013c7f04f786d7b8a660c8d648b798
parentc8714b29157d534ac0078541c4075211f287afdb
xhci: don't dereference a xhci member after removing xhci

commit f1f6d9a8b540df22b87a5bf6bc104edaade81f47 upstream.

Remove the hcd after checking for the xhci last quirks, not before.

This caused a hang on a Alpine Ridge xhci based maching which remove
the whole xhci controller when unplugging the last usb device

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/host/xhci-pci.c