]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: xhci: Free the right ring in xhci_add_endpoint()
authorLu Baolu <baolu.lu@linux.intel.com>
Mon, 18 Sep 2017 14:39:12 +0000 (17:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:10 +0000 (11:56 +0200)
commit7282898c6eeff27b9298bc36ff10fd9ca2a931ea
tree94d5ca4ac897c8b99652dd9ea390e41269ac52dd
parent31991559f483b33eb30b7fdb1219b3f78b616a27
usb: xhci: Free the right ring in xhci_add_endpoint()

commit 9821786d7c90eee2f6852261893d9703801aae47 upstream.

In the xhci_add_endpoint(), a new ring was allocated and saved at
xhci_virt_ep->new_ring. Hence, when error happens, we need to free
the allocated ring before returning error.

Current code frees xhci_virt_ep->ring instead of the new_ring. This
patch fixes this.

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