]> asedeno.scripts.mit.edu Git - linux.git/commit
usb: xhci: Fix memory leak when xhci_disable_slot() returns error
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 5 Oct 2017 08:21:42 +0000 (11:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 09:01:58 +0000 (11:01 +0200)
commit11ec7588a10d4bc2e1e385ac565d2166d375fba1
treee1fd8702f33cd3378a27342971eb64bf82229e9a
parentcd3f1790b006d91786728c20a01da21ee277aff1
usb: xhci: Fix memory leak when xhci_disable_slot() returns error

If xhci_disable_slot() returns success, a disable slot command
trb was queued in the command ring. The command completion
handler will free the virtual device data structure associated
with the slot. On the other hand, when xhci_disable_slot()
returns error, the invokers should take the responsibilities to
free the slot related data structure. Otherwise, memory leakage
happens.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c