Commit d8ff463a authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman

ehci-hcd: Cleanup memory resources when ehci_halt fails

The driver calls ehci_mem_init to allocate memory resources.
But these resources are not freed when ehci_halt fails.

This patch adds "ehci_mem_cleanup" in error handling code to fix this problem.
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@163.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4bb3cad7
......@@ -675,8 +675,10 @@ int ehci_setup(struct usb_hcd *hcd)
return retval;
retval = ehci_halt(ehci);
if (retval)
if (retval) {
ehci_mem_cleanup(ehci);
return retval;
}
ehci_reset(ehci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment