Skip to content

Commit

Permalink
ehci-hcd: Cleanup memory resources when ehci_halt fails
Browse files Browse the repository at this point in the history
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: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jia-Ju Bai authored and Greg Kroah-Hartman committed Jan 25, 2016
1 parent 4bb3cad commit d8ff463
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d8ff463

Please sign in to comment.