All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()
@ 2019-03-21  6:28 ` Dan Carpenter
  0 siblings, 0 replies; 11+ messages in thread
From: Dan Carpenter @ 2019-03-21  6:28 UTC (permalink / raw)
  To: Alex Deucher, Kevin Wang
  Cc: David (ChunMing) Zhou, Chengming Gui, David Airlie,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Huang Rui,
	Daniel Vetter, Likun Gao, Christian König

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@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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-03-21  8:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21  6:28 [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table() Dan Carpenter
2019-03-21  6:28 ` Dan Carpenter
2019-03-21  6:52 ` Huang, Ray
2019-03-21  6:52   ` Huang, Ray
     [not found]   ` <MN2PR12MB3309B7C391B32EB8F5F87676EC420-rweVpJHSKTpWdvXm18W95QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-21  8:20     ` Julia Lawall
2019-03-21  8:20       ` Julia Lawall
2019-03-21  8:23       ` Dan Carpenter
2019-03-21  8:23         ` Dan Carpenter
2019-03-21  8:26         ` Julia Lawall
2019-03-21  8:26           ` Julia Lawall
2019-03-21  7:06 ` Wang, Kevin(Yang)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.