aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorDan Carpenter2024-01-12 17:30:18 +0300
committerRafael J. Wysocki2024-01-12 15:53:54 +0100
commit6dcb35088e264306b948141971286257681ca412 (patch)
treee550b1828d918472838f52b9e3b2e30dee167c7f /drivers/thermal
parente95fa7404716f6e25021e66067271a4ad8eb1486 (diff)
thermal/debugfs: Unlock on error path in thermal_debug_tz_trip_up()
Add a missing mutex_unlock(&thermal_dbg->lock) to this error path. Fixes: 7ef01f228c9f ("thermal/debugfs: Add thermal debugfs information for mitigation episodes") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_debugfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c
index b53881e9e0b6..c617e8b9f0dd 100644
--- a/drivers/thermal/thermal_debugfs.c
+++ b/drivers/thermal/thermal_debugfs.c
@@ -592,7 +592,7 @@ void thermal_debug_tz_trip_up(struct thermal_zone_device *tz,
if (!tz_dbg->nr_trips) {
tze = thermal_debugfs_tz_event_alloc(tz, now);
if (!tze)
- return;
+ goto unlock;
list_add(&tze->node, &tz_dbg->tz_episodes);
}
@@ -620,6 +620,7 @@ void thermal_debug_tz_trip_up(struct thermal_zone_device *tz,
(temperature - tze->trip_stats[trip_id].avg) /
tze->trip_stats[trip_id].count;
+unlock:
mutex_unlock(&thermal_dbg->lock);
}