USB: XHCI: fix memory leak of URB-private data
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 17 Jan 2013 15:32:16 +0000 (10:32 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Feb 2013 17:04:46 +0000 (09:04 -0800)
commit50b0e5fa40ea3e0460174a449f3853d5790c6a16
treef046a1f2058d6a5cb30cd0b6fe6328c8446868e3
parenta2fdda608b6dc8c15496cfbf23d0e37efbc28532
USB: XHCI: fix memory leak of URB-private data

commit 48c3375c5f69b1c2ef3d1051a0009cb9bce0ce24 upstream.

This patch (as1640) fixes a memory leak in xhci-hcd.  The urb_priv
data structure isn't always deallocated in the handle_tx_event()
routine for non-control transfers.  The patch adds a kfree() call so
that all paths end up freeing the memory properly.

This patch should be backported to kernels as old as 2.6.36, that
contain the commit 8e51adccd4c4b9ffcd509d7f2afce0a906139f75 "USB: xHCI:
Introduce urb_priv structure"

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-and-tested-by: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c