From: "Bhardwaj, Rajneesh" <Rajneesh.Bhardwaj@amd.com>
To: "Kuehling, Felix" <Felix.Kuehling@amd.com>,
Alex Deucher <alexdeucher@gmail.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>
Subject: RE: [PATCH 4/4] drm/amdkfd: fix ref count leak when pm_runtime_get_sync fails
Date: Wed, 17 Jun 2020 20:26:52 +0000 [thread overview]
Message-ID: <BN6PR12MB1155F8B21B98948FD107F747FE9A0@BN6PR12MB1155.namprd12.prod.outlook.com> (raw)
In-Reply-To: <68e00259-d3dc-2ed8-cb66-faee4cb17716@amd.com>
[AMD Official Use Only - Internal Distribution Only]
Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
-----Original Message-----
From: Kuehling, Felix <Felix.Kuehling@amd.com>
Sent: Wednesday, June 17, 2020 4:17 PM
To: Alex Deucher <alexdeucher@gmail.com>; amd-gfx@lists.freedesktop.org; Bhardwaj, Rajneesh <Rajneesh.Bhardwaj@amd.com>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 4/4] drm/amdkfd: fix ref count leak when pm_runtime_get_sync fails
[+Rajneesh]
Am 2020-06-17 um 3:02 p.m. schrieb Alex Deucher:
> The call to pm_runtime_get_sync 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: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_process.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index a9a7f5aa2710..0b4f40905f55 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -1116,8 +1116,10 @@ struct kfd_process_device *kfd_bind_process_to_device(struct kfd_dev *dev,
> */
> if (!pdd->runtime_inuse) {
> err = pm_runtime_get_sync(dev->ddev->dev);
> - if (err < 0)
> + if (err < 0) {
> + pm_runtime_put_autosuspend(dev->ddev->dev);
> return ERR_PTR(err);
> + }
> }
>
> err = kfd_iommu_bind_process_to_device(pdd);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-06-17 20:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 19:02 [PATCH 1/4] drm/amdgpu/debugfs: fix ref count leak when pm_runtime_get_sync fails Alex Deucher
2020-06-17 19:02 ` [PATCH 2/4] drm/amdgpu/pm: " Alex Deucher
2020-06-18 4:24 ` Quan, Evan
2020-06-17 19:02 ` [PATCH 3/4] drm/amdgpu/fence: " Alex Deucher
2020-06-17 20:27 ` Bhardwaj, Rajneesh
2020-06-17 19:02 ` [PATCH 4/4] drm/amdkfd: " Alex Deucher
2020-06-17 20:16 ` Felix Kuehling
2020-06-17 20:26 ` Bhardwaj, Rajneesh [this message]
2020-06-18 4:25 ` [PATCH 1/4] drm/amdgpu/debugfs: " Quan, Evan
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=BN6PR12MB1155F8B21B98948FD107F747FE9A0@BN6PR12MB1155.namprd12.prod.outlook.com \
--to=rajneesh.bhardwaj@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
/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).