lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1601041025470.1630-100000@iolanthe.rowland.org>
Date:	Mon, 4 Jan 2016 10:26:26 -0500 (EST)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Jia-Ju Bai <baijiaju1990@....com>
cc:	sergei.shtylyov@...entembedded.com, <gregkh@...uxfoundation.org>,
	USB list <linux-usb@...r.kernel.org>,
	Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] ehci-hcd: Cleanup memory resources when ehci_halt
 fails

On Mon, 4 Jan 2016, Jia-Ju Bai wrote:

> 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@....com>
> ---
>  drivers/usb/host/ehci-hcd.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 48c92bf..015b411 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -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);
>  

Acked-by: Alan Stern <stern@...land.harvard.edu>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ