From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: wu000273@umn.edu
Cc: kjlu@umn.edu,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: vsp1: Fix a reference count leak.
Date: Tue, 16 Jun 2020 05:09:56 +0300 [thread overview]
Message-ID: <20200616020956.GL1629@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200616020732.GK1629@pendragon.ideasonboard.com>
On Tue, Jun 16, 2020 at 05:07:34AM +0300, Laurent Pinchart wrote:
> Hi Qiushi,
>
> (CC'ing Rafael and Geert)
>
> Thank you for the patch.
>
> On Sat, Jun 13, 2020 at 06:23:57PM -0500, wu000273@umn.edu wrote:
> > From: Qiushi Wu <wu000273@umn.edu>
> >
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when it returns an error code, causing incorrect ref count if
> > pm_runtime_put_noidle() is not called in error handling paths.
> > Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails.
> >
> > Fixes: 1e6af546ee66 ("[media] v4l: vsp1: Implement runtime PM support")
> > Signed-off-by: Qiushi Wu <wu000273@umn.edu>
>
> https://lore.kernel.org/dri-devel/20200614134655.GA5960@pendragon.ideasonboard.com/
>
> I really wonder if mass-patching all drivers is the best way forward.
Also,
https://lore.kernel.org/linux-media/20200608052919.4984-1-dinghao.liu@zju.edu.cn/
> > ---
> > drivers/media/platform/vsp1/vsp1_drv.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
> > index c650e45bb0ad..222c9e1261a0 100644
> > --- a/drivers/media/platform/vsp1/vsp1_drv.c
> > +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> > @@ -846,8 +846,10 @@ static int vsp1_probe(struct platform_device *pdev)
> > pm_runtime_enable(&pdev->dev);
> >
> > ret = pm_runtime_get_sync(&pdev->dev);
> > - if (ret < 0)
> > + if (ret < 0) {
> > + pm_runtime_put_noidle(&pdev->dev);
> > goto done;
> > + }
> >
> > vsp1->version = vsp1_read(vsp1, VI6_IP_VERSION);
> > pm_runtime_put_sync(&pdev->dev);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-06-16 2:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-13 23:23 [PATCH] media: vsp1: Fix a reference count leak wu000273
2020-06-16 2:07 ` Laurent Pinchart
2020-06-16 2:09 ` Laurent Pinchart [this message]
2020-06-22 10:21 ` Hans Verkuil
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=20200616020956.GL1629@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=geert@linux-m68k.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--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