xhci: delete endpoints from bandwidth list before freeing whole device
commit28170033c7ccff7c8ebcf1e648e26f1801e8f198
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 28 May 2014 20:51:13 +0000 (28 23:51 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 Jul 2014 12:33:44 +0000 (11 13:33 +0100)
tree0ee582190177f3efd8fab620f410ccd09f97066d
parentd70ca1085a097b191679d6c146b0887d2f5ca3c4
xhci: delete endpoints from bandwidth list before freeing whole device

commit 5dc2808c4729bf080487e61b80ee04e0fdb12a37 upstream.

Lists of endpoints are stored for bandwidth calculation for roothub ports.
Make sure we remove all endpoints from the list before the whole device,
containing its endpoints list_head stuctures, is freed.

This used to be done in the wrong order in xhci_mem_cleanup(),
and triggered an oops in resume from S4 (hibernate).

Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/host/xhci-mem.c