2023-02-16 12:15:20

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] 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()")
Signed-off-by: Dan Carpenter <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 1ab768feccaa..728150b35537 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -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;
}

--
2.39.1



2023-02-16 13:25:21

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH] 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()")
> Signed-off-by: Dan Carpenter <[email protected]>

Acked-by: Lorenzo Bianconi <[email protected]>

> ---
> drivers/net/wireless/mediatek/mt76/mt7915/init.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index 1ab768feccaa..728150b35537 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -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;
> }
>
> --
> 2.39.1
>


Attachments:
(No filename) (918.00 B)
signature.asc (228.00 B)
Download all attachments