USB: xhci - also free streams when resetting devices
commita6cba0b73761e2d3b94b0cceb15ee1f5f52d2b85
authorDmitry Torokhov <dtor@vmware.com>
Wed, 13 Apr 2011 06:06:28 +0000 (12 23:06 -0700)
committerAndi Kleen <ak@linux.intel.com>
Thu, 28 Apr 2011 15:21:16 +0000 (28 08:21 -0700)
tree602cfe2e222cc457edeecdecca835d5f952c85ae
parente6d11da6869184f5cd3375a2b636e1aae9898a8f
USB: xhci - also free streams when resetting devices

upstream commit: 2dea75d96ade3c7cd2bfe73f99c7b3291dc3d03a

Currently, when resetting a device, xHCI driver disables all but one
endpoints and frees their rings, but leaves alone any streams that
might have been allocated. Later, when users try to free allocated
streams, we oops in xhci_setup_no_streams_ep_input_ctx() because
ep->ring is NULL.

Let's free not only rings but also stream data as well, so that
calling free_streams() on a device that was reset will be safe.

This should be queued for stable trees back to 2.6.35.

Reviewed-by: Micah Elizabeth Scott <micah@vmware.com>
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: stable@kernel.org
drivers/usb/host/xhci.c