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: <2e8e923c-3f3d-29ff-6abf-ae333b81bd45@cogentembedded.com>
Date:   Sun, 14 Jun 2020 11:50:18 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Aditya Pakki <pakki001@....edu>
Cc:     kjlu@....edu, wu000273@....edu, Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: dwc3: pci: Fix reference count leak in
 dwc3_pci_resume_work

Hello!

On 14.06.2020 6:15, Aditya Pakki wrote:

> dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments
> the reference counter. In case of failure, decrement the reference
> count and return the error.

    In this case you still return nothing.

> 
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>   drivers/usb/dwc3/dwc3-pci.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index b67372737dc9..96c05b121fac 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -206,8 +206,10 @@ static void dwc3_pci_resume_work(struct work_struct *work)
>   	int ret;
>   
>   	ret = pm_runtime_get_sync(&dwc3->dev);
> -	if (ret)
> +	if (ret) {
> +		pm_runtime_put_sync_autosuspend(&dwc3->dev);
>   		return;
> +	}
>   
>   	pm_runtime_mark_last_busy(&dwc3->dev);
>   	pm_runtime_put_sync_autosuspend(&dwc3->dev);

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ