From: Alex Deucher <alexdeucher@gmail.com>
To: Chen Tao <chentao107@huawei.com>
Cc: Tom St Denis <tom.stdenis@amd.com>, Jack Xiao <Jack.Xiao@amd.com>,
Dave Airlie <airlied@linux.ie>,
amd-gfx list <amd-gfx@lists.freedesktop.org>,
Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
Christian Koenig <christian.koenig@amd.com>,
Yintian Tao <yttao@amd.com>
Subject: Re: [PATCH v2 2/2] drm/amdgpu/debugfs: fix memory leak when amdgpu_virt_enable_access_debugfs failed
Date: Wed, 17 Jun 2020 14:04:19 -0400 [thread overview]
Message-ID: <CADnq5_N8QDurdw_kYRbGUSbaaJYLpbJi=uDk4dYkHNVfnJtGFg@mail.gmail.com> (raw)
In-Reply-To: <20200617105130.207116-2-chentao107@huawei.com>
Applied. Thanks!
Alex
On Wed, Jun 17, 2020 at 9:10 AM Chen Tao <chentao107@huawei.com> wrote:
>
> Fix memory leak in amdgpu_debugfs_gpr_read not freeing data when
> amdgpu_virt_enable_access_debugfs failed.
>
> Fixes: 95a2f917387a2 ("drm/amdgpu: restrict debugfs register accessunder SR-IOV")
> Signed-off-by: Chen Tao <chentao107@huawei.com>
> ---
> v1->v2:
> - remove the duplication of result and r here and then use "goto err"
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 7993b9eeff38..7086e1982f9e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -867,7 +867,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
>
> r = amdgpu_virt_enable_access_debugfs(adev);
> if (r < 0)
> - return r;
> + goto err;
>
> /* switch to the specific se/sh/cu */
> mutex_lock(&adev->grbm_idx_mutex);
> --
> 2.22.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2020-06-17 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 10:51 [PATCH v2 1/2] drm/amdgpu/debugfs: fix memory leak when pm_runtime_get_sync failed Chen Tao
2020-06-17 10:51 ` [PATCH v2 2/2] drm/amdgpu/debugfs: fix memory leak when amdgpu_virt_enable_access_debugfs failed Chen Tao
2020-06-17 18:04 ` Alex Deucher [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='CADnq5_N8QDurdw_kYRbGUSbaaJYLpbJi=uDk4dYkHNVfnJtGFg@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=Jack.Xiao@amd.com \
--cc=airlied@linux.ie \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chentao107@huawei.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=tom.stdenis@amd.com \
--cc=yttao@amd.com \
/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).