From: Monk Liu <Monk.Liu@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Monk Liu <Monk.Liu@amd.com>
Subject: [PATCH 2/3] drm/amdgpu: fix memory leak during TDR test
Date: Tue, 18 Feb 2020 10:54:12 +0800 [thread overview]
Message-ID: <1581994453-5498-2-git-send-email-Monk.Liu@amd.com> (raw)
In-Reply-To: <1581994453-5498-1-git-send-email-Monk.Liu@amd.com>
fix system memory leak regression introduced
by this previous change of 201331 - Single VF Mode Test
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 9d15acf..3363f1c 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -978,8 +978,12 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
struct smu_11_0_max_sustainable_clocks *max_sustainable_clocks;
int ret = 0;
- max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
+ if (smu->smu_table.max_sustainable_clocks == NULL)
+ max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
GFP_KERNEL);
+ else
+ max_sustainable_clocks = smu->smu_table.max_sustainable_clocks;
+
smu->smu_table.max_sustainable_clocks = (void *)max_sustainable_clocks;
max_sustainable_clocks->uclock = smu->smu_table.boot_values.uclk / 100;
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-02-18 2:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 2:54 [PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV Monk Liu
2020-02-18 2:54 ` Monk Liu [this message]
2020-02-18 11:10 ` [PATCH 2/3] drm/amdgpu: fix memory leak during TDR test Zhang, Hawking
2020-02-18 2:54 ` [PATCH 3/3] drm/amdgpu: fix colliding of preemption Monk Liu
2020-02-18 11:32 ` Zhang, Hawking
2020-02-18 11:48 ` Zhang, Hawking
2020-02-18 12:29 ` 回复: " Liu, Monk
2020-02-18 12:39 ` Christian König
2020-02-18 12:53 ` 回复: " Liu, Monk
2020-02-18 14:48 ` Fernlund, Hans
2020-02-19 5:04 ` 回复: " Liu, Monk
2020-02-19 8:27 ` Christian König
2020-02-18 14:54 ` Zhang, Hawking
2020-02-19 5:05 ` 回复: " Liu, Monk
2020-02-18 12:19 ` Liu, Monk
2020-02-18 11:08 ` [PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV Zhang, Hawking
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=1581994453-5498-2-git-send-email-Monk.Liu@amd.com \
--to=monk.liu@amd.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