[Intel-gfx] [PATCH] drm/i915/slpc: Fix inconsistent locked return

Rodrigo Vivi rodrigo.vivi at intel.com
Tue Aug 30 15:02:29 UTC 2022


Fix for intel_guc_slpc_set_min_freq() warn: inconsistent returns '&slpc->lock'.

Fixes: 95ccf312a1e4 ("drm/i915/guc/slpc: Allow SLPC to use efficient frequency")
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
index 9d49ccef03bb..f8a2bbcdf14f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
@@ -477,7 +477,7 @@ int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val)
 		if (unlikely(ret)) {
 			i915_probe_error(i915, "Failed to toggle efficient freq (%pe)\n",
 					 ERR_PTR(ret));
-			return ret;
+			goto unlock;
 		}
 
 		ret = slpc_set_param(slpc,
@@ -492,6 +492,7 @@ int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val)
 	if (!ret)
 		slpc->min_freq_softlimit = val;
 
+unlock:
 	mutex_unlock(&slpc->lock);
 
 	return ret;
-- 
2.37.2



More information about the Intel-gfx mailing list