From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Steven Price <steven.price@arm.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
emamd001@umn.edu, wu000273@umn.edu, kjlu@umn.edu,
smccaman@umn.edu
Subject: Re: [PATCH] drm/panfrost: fix ref count leak in panfrost_job_hw_submit
Date: Mon, 6 Jul 2020 22:31:28 -0400 [thread overview]
Message-ID: <20200707023128.GA16527@kevin> (raw)
In-Reply-To: <20200614062730.46489-1-navid.emamdoost@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
On Sun, Jun 14, 2020 at 01:27:30AM -0500, Navid Emamdoost wrote:
> in panfrost_job_hw_submit, 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/panfrost/panfrost_job.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
> index 7914b1570841..89ac84667eb1 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> @@ -147,11 +147,10 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
>
> ret = pm_runtime_get_sync(pfdev->dev);
> if (ret < 0)
> - return;
> + goto out;
>
> if (WARN_ON(job_read(pfdev, JS_COMMAND_NEXT(js)))) {
> - pm_runtime_put_sync_autosuspend(pfdev->dev);
> - return;
> + goto out;
> }
>
> cfg = panfrost_mmu_as_get(pfdev, &job->file_priv->mmu);
> @@ -184,6 +183,9 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
> job, js, jc_head);
>
> job_write(pfdev, JS_COMMAND_NEXT(js), JS_COMMAND_START);
> +out:
> + pm_runtime_put_sync_autosuspend(pfdev->dev);
> + return;
> }
>
> static void panfrost_acquire_object_fences(struct drm_gem_object **bos,
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-07-07 2:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 6:27 [PATCH] drm/panfrost: fix ref count leak in panfrost_job_hw_submit Navid Emamdoost
2020-07-07 2:31 ` Alyssa Rosenzweig [this message]
2020-07-09 15:44 ` Rob Herring
2020-07-09 15:59 ` Steven Price
-- strict thread matches above, loose matches on Subject: below --
2020-06-14 11:31 Markus Elfring
2020-06-14 11:31 Markus Elfring
2020-06-14 11:31 Markus Elfring
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=20200707023128.GA16527@kevin \
--to=alyssa.rosenzweig@collabora.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=robh@kernel.org \
--cc=smccaman@umn.edu \
--cc=steven.price@arm.com \
--cc=tomeu.vizoso@collabora.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