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>
Mon, 18 Sep 2017 15:10:40 +0000 (17:10 +0200)
commit9821786d7c90eee2f6852261893d9703801aae47
tree0156008d136d70abbed8c05746363abe28112843
parentb2a542bbb3081dbd64acc8929c140d196664c406
usb: xhci: Free the right ring in xhci_add_endpoint()

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.

Cc: <stable@vger.kernel.org>
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