[PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()
Wang, Kevin(Yang)
Kevin1.Wang at amd.com
Thu Mar 21 07:06:07 UTC 2019
Hi Dan,
Thank you for your careful attention to the problem.
I made the mistake of this patch, when we do code rebase internally.
and your patch is looks fine for me.
Reviewed-by: Kevin Wang <kevin1.wang at amd.com>
Thanks.
Best Regards,
Kevin
________________________________
From: Dan Carpenter <dan.carpenter at oracle.com>
Sent: Thursday, March 21, 2019 2:28:22 PM
To: Deucher, Alexander; Wang, Kevin(Yang)
Cc: Koenig, Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; Huang, Ray; Gao, Likun; Gui, Jack; amd-gfx at lists.freedesktop.org; kernel-janitors at vger.kernel.org
Subject: [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()
We already unlocked a few lines earlier so this code unlocks twice on
the success path.
Fixes: 5809d7420f97 ("drm/amd/powerplay: implement sysfs of pp_table for smu11 (v2)")
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
---
I'm not sure what this bug looks like at runtime, but it's slightly
weird that no one noticed. This is from static analysis and I haven't
tested it myself.
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 00b7c885772b..7e8c74da6a74 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -187,6 +187,8 @@ int smu_sys_set_pp_table(struct smu_context *smu, void *buf, size_t size)
if (ret)
pr_info("smu reset failed, ret = %d\n", ret);
+ return ret;
+
failed:
mutex_unlock(&smu->mutex);
return ret;
--
2.17.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190321/0dbf529e/attachment.html>
More information about the amd-gfx
mailing list