From: Felix Kuehling <felix.kuehling@amd.com>
To: "Bernard Zhao" <bernard@vivo.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Hawking Zhang" <Hawking.Zhang@amd.com>,
"John Clements" <john.clements@amd.com>,
"Jonathan Kim" <jonathan.kim@amd.com>,
"Kevin Wang" <kevin1.wang@amd.com>,
"Tian Tao" <tiantao6@hisilicon.com>,
"Evan Quan" <evan.quan@amd.com>, shaoyunl <shaoyun.liu@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/amdgpu: fix potential memleak
Date: Mon, 15 Nov 2021 10:56:28 -0500 [thread overview]
Message-ID: <50ed4525-dbe6-1eac-5b83-4233a18a6176@amd.com> (raw)
In-Reply-To: <20211115025901.2598-1-bernard@vivo.com>
Am 2021-11-14 um 9:58 p.m. schrieb Bernard Zhao:
> In function amdgpu_get_xgmi_hive, when kobject_init_and_add failed
> There is a potential memleak if not call kobject_put.
>
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index 0fad2bf854ae..567df2db23ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -386,6 +386,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
> "%s", "xgmi_hive_info");
> if (ret) {
> dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
> + kobject_put(&hive->kobj);
> kfree(hive);
> hive = NULL;
> goto pro_end;
next prev parent reply other threads:[~2021-11-15 15:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 2:58 Bernard Zhao
2021-11-15 15:56 ` Felix Kuehling [this message]
2021-11-17 21:34 ` Alex Deucher
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=50ed4525-dbe6-1eac-5b83-4233a18a6176@amd.com \
--to=felix.kuehling@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bernard@vivo.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=evan.quan@amd.com \
--cc=john.clements@amd.com \
--cc=jonathan.kim@amd.com \
--cc=kevin1.wang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shaoyun.liu@amd.com \
--cc=tiantao6@hisilicon.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
all inboxes | Powered by JetHome®