linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Navid Emamdoost <emamd001@umn.edu>, Qiushi Wu <wu000273@umn.edu>,
	Kangjie Lu <kjlu@umn.edu>, Stephen McCamant <smccaman@umn.edu>
Subject: Re: [PATCH] drm/exynos: fix ref count leak in mic_pre_enable
Date: Mon, 15 Jun 2020 00:50:24 -0500	[thread overview]
Message-ID: <CAEkB2ESuG7omgvdEnfQ+hV_uWa1mhK=22VnN++TaFqOycaTc_A@mail.gmail.com> (raw)
In-Reply-To: <027d9eb5-a1c1-c329-72c3-a555b71f8677@samsung.com>

On Sun, Jun 14, 2020 at 7:47 PM Inki Dae <inki.dae@samsung.com> wrote:
>
> Hi,
>
> 20. 6. 14. 오후 3:23에 Navid Emamdoost 이(가) 쓴 글:
> > in mic_pre_enable, pm_runtime_get_sync is called which
> > increments the counter even in case of failure, leading to incorrect
> > ref count. In case of failure, decrement the ref count before returning.
> >
> > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> > ---
> >  drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
> > index a86abc173605..69ff74c2ceb5 100644
> > --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
> > +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
> > @@ -270,7 +270,7 @@ static void mic_pre_enable(struct drm_bridge *bridge)
> >
> >       ret = pm_runtime_get_sync(mic->dev);
> >       if (ret < 0)
> > -             goto unlock;
> > +             goto turn_off;
>
> How about just calling pm_runtime_put_noidle()?
>
> if (ret < 0) {
>         pm_runtime_put_noidle(mic->dev);
>         goto unlock;
> }
>
v2 was sent.

> Thanks,
> Inki Dae
>
> >
> >       mic_set_path(mic, 1);
> >
> >



-- 
Navid.

      parent reply	other threads:[~2020-06-15  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200614062349epcas1p1e285479c1e6483708b62f93e70a453a4@epcas1p1.samsung.com>
2020-06-14  6:23 ` [PATCH] drm/exynos: fix ref count leak in mic_pre_enable Navid Emamdoost
2020-06-15  0:52   ` Inki Dae
2020-06-15  5:49     ` [PATCH v2] " Navid Emamdoost
2020-06-16  1:13       ` Inki Dae
2020-06-15  5:50     ` Navid Emamdoost [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='CAEkB2ESuG7omgvdEnfQ+hV_uWa1mhK=22VnN++TaFqOycaTc_A@mail.gmail.com' \
    --to=navid.emamdoost@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emamd001@umn.edu \
    --cc=inki.dae@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kjlu@umn.edu \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=smccaman@umn.edu \
    --cc=sw0312.kim@samsung.com \
    --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).