Commit 6dcb3508 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki
Browse files

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: 7ef01f22 ("thermal/debugfs: Add thermal debugfs information for mitigation episodes")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent e95fa740
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
}