From: 李阳 <u202112136@hust.edu.cn>
To: "greg kroah-hartman" <gregkh@linuxfoundation.org>
Cc: "felipe balbi" <balbi@kernel.org>,
"sergey shtylyov" <s.shtylyov@omp.ru>,
"dongliang mu" <dzm91@hust.edu.cn>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
hust-os-kernel-patches@googlegroups.com
Subject: Re: Re: [PATCH] usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe()
Date: Tue, 18 Apr 2023 18:48:29 +0800 (GMT+08:00) [thread overview]
Message-ID: <7aadd2ae.3f01f.18793faf0c3.Coremail.u202112136@hust.edu.cn> (raw)
In-Reply-To: <2023041832-parakeet-claim-b458@gregkh>
> -----Original Messages-----
> From: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
> Sent Time: 2023-04-18 17:19:12 (Tuesday)
> To: "Li Yang" <lidaxian@hust.edu.cn>
> Cc: "Felipe Balbi" <balbi@kernel.org>, "Sergey Shtylyov" <s.shtylyov@omp.ru>, "Dongliang Mu" <dzm91@hust.edu.cn>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe()
>
> On Tue, Apr 18, 2023 at 05:07:57PM +0800, Li Yang wrote:
> > Smatch reports:
> > drivers/usb/phy/phy-tahvo.c: tahvo_usb_probe()
> > warn: missing unwind goto?
> >
> > After geting irq, if ret < 0, it will return without error handling to
> > free memory.
> > Just add error handling to fix this problem.
> >
> > Fixes: 0d45a1373e66 ("usb: phy: tahvo: add IRQ check")
> > Signed-off-by: Li Yang <lidaxian@hust.edu.cn>
> > Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
> > ---
> > The issue is found by static analysis, and the patch remains untest.
> > ---
> > drivers/usb/phy/phy-tahvo.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
> > index f2d2cc586c5b..184a5f3d7473 100644
> > --- a/drivers/usb/phy/phy-tahvo.c
> > +++ b/drivers/usb/phy/phy-tahvo.c
> > @@ -390,8 +390,11 @@ static int tahvo_usb_probe(struct platform_device *pdev)
> > dev_set_drvdata(&pdev->dev, tu);
> >
> > tu->irq = ret = platform_get_irq(pdev, 0);
> > - if (ret < 0)
> > - return ret;
> > + if (ret < 0) {
> > + dev_err(&pdev->dev, "could not get irq: %d\n",
> > + ret);
>
> Why print this out? And why the odd line-wrapping?
>
> thanks,
>
> greg k-h
For the first question, I am just emulating the coding style of the original author who outputs corresponding information after each error. If there is anything unreasonable about doing so, please let me know. As for the second question, it's my mistake and I will correct it immediately.
regrads,
Li Yang
next prev parent reply other threads:[~2023-04-18 10:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 9:07 [PATCH] usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe() Li Yang
2023-04-18 9:17 ` 李阳
2023-04-18 9:19 ` Greg Kroah-Hartman
2023-04-18 10:48 ` 李阳 [this message]
2023-04-18 11:17 ` Sergey Shtylyov
2023-04-19 9:00 ` Sergey Shtylyov
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=7aadd2ae.3f01f.18793faf0c3.Coremail.u202112136@hust.edu.cn \
--to=u202112136@hust.edu.cn \
--cc=balbi@kernel.org \
--cc=dzm91@hust.edu.cn \
--cc=gregkh@linuxfoundation.org \
--cc=hust-os-kernel-patches@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
/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