USB: xhci: Avoid double free after streams are disabled.
commit8a007748fbadb8317d0af289f3bca5694354d63a
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 30 Apr 2010 22:37:56 +0000 (30 15:37 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:40 +0000 (20 13:21 -0700)
treebfeefd0403ea4f810d35a9c1ad087561c2a19c83
parent85bcb5ee889e0ebb9154718939e049de265fcdfb
USB: xhci: Avoid double free after streams are disabled.

When a device is disconnected, xhci_free_virt_device() is called.  Ramya
found that if the device had streams enabled, and then the driver freed
the streams with a call to usb_free_streams(), then about a minute after
he had called this, his machine crashed with a Bad DMA error.  It turns
out that xhci_free_virt_device() would attempt to free the endpoint's
stream_info data structure if it wasn't NULL, and the free streams
function was not setting it to NULL after freeing it.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Ramya Desai <ramya.desai@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci.c