]> git.itanic.dy.fi Git - linux-stable/commitdiff
thermal/debugfs: Unlock on error path in thermal_debug_tz_trip_up()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 12 Jan 2024 14:30:18 +0000 (17:30 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 12 Jan 2024 14:53:54 +0000 (15:53 +0100)
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>
drivers/thermal/thermal_debugfs.c

index b53881e9e0b6e088f2d0e61052681eb3cf0f52c4..c617e8b9f0ddfe18bcb34155e156af47e4006837 100644 (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);
 }