From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, wu000273@umn.edu, Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work
Date: Sun, 14 Jun 2020 11:50:18 +0300 [thread overview]
Message-ID: <2e8e923c-3f3d-29ff-6abf-ae333b81bd45@cogentembedded.com> (raw)
In-Reply-To: <20200614031525.128556-1-pakki001@umn.edu>
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@umn.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
prev parent reply other threads:[~2020-06-14 8:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 3:15 [PATCH] usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work Aditya Pakki
2020-06-14 8:50 ` Sergei Shtylyov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e8e923c-3f3d-29ff-6abf-ae333b81bd45@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=wu000273@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).