提交 d8ff463a 编写于 作者: J Jia-Ju Bai 提交者: 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: NJia-Ju Bai <baijiaju1990@163.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册