USB: xhci - also free streams when resetting devices
commit994133a056515517a16bfac485e9741188a71912
authorDmitry Torokhov <dtor@vmware.com>
Wed, 13 Apr 2011 06:06:28 +0000 (12 23:06 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Apr 2011 21:32:57 +0000 (21 14:32 -0700)
tree2f6401d1461eb7d10baebe4de913ee97b74bf8ed
parentb9d75083e022102b4f24dd0f8ebaa14ab4568bbf
USB: xhci - also free streams when resetting devices

commit 2dea75d96ade3c7cd2bfe73f99c7b3291dc3d03a upstream.

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: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci.c