Skip to contentSkip to conversation

wifi: mt76: mt7915: unlock on error in mt7915_thermal_temp_store()

PATCH In review Dan Carpenter 2 participants 2 messages Feb 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mt76: mt7915: unlock on error in mt7915_thermal_temp_store()

Drop the lock before returning -EINVAL.

Fixes ecaccdae7a7e ("wifi: mt76: mt7915: rework mt7915_thermal_temp_store()")
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -0
index 1ab768feccaa..728150b35537 100644
@@ -89,6 +89,7 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,
 	     val < phy->throttle_temp[MT7915_CRIT_TEMP_IDX])) {
 		dev_err(phy->dev->mt76.dev,
 			"temp1_max shall be greater than temp1_crit.");
+		mutex_unlock(&phy->dev->mt76.mutex);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.39.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

Drop the lock before returning -EINVAL.

Fixes ecaccdae7a7e ("wifi: mt76: mt7915: rework mt7915_thermal_temp_store()")
Quoted 19 lines
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -0
index 1ab768feccaa..728150b35537 100644
@@ -89,6 +89,7 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,
 	     val < phy->throttle_temp[MT7915_CRIT_TEMP_IDX])) {
 		dev_err(phy->dev->mt76.dev,
 			"temp1_max shall be greater than temp1_crit.");
+		mutex_unlock(&phy->dev->mt76.mutex);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.39.1