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>
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);
}
(temperature - tze->trip_stats[trip_id].avg) /
tze->trip_stats[trip_id].count;
+unlock:
mutex_unlock(&thermal_dbg->lock);
}