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: 7ef01f228c ("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>
This commit is contained in:
Dan Carpenter 2024-01-12 17:30:18 +03:00 committed by Rafael J. Wysocki
parent e95fa74047
commit 6dcb35088e

View File

@ -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);
}