xhci: delete endpoints from bandwidth list before freeing whole device
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 28 May 2014 20:51:13 +0000 (23:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jun 2014 19:03:24 +0000 (12:03 -0700)
commit6e9a86e1e78b462d38e74ad47a8d32a3e0abe6bd
treec58d439193cad51bf45c47c51ba5e5bddbd54e99
parent88580b125ac63b24bbba7f71bd235f27c65f5baa
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c