]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7915: unlock on error in mt7915_thermal_temp_store()
authorDan Carpenter <error27@gmail.com>
Thu, 16 Feb 2023 12:15:05 +0000 (15:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:16 +0000 (23:11 +0900)
[ Upstream commit cdc215c2c8d74b3c8886650e979b47f16c1f7f92 ]

Drop the lock before returning -EINVAL.

Fixes: ecaccdae7a7e ("wifi: mt76: mt7915: rework mt7915_thermal_temp_store()")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7915/init.c

index a80ae31e7abffe6ef0b34cbbdbff5a7426927271..916d6c7c569d3ffbd57f159451bd67cc7a0b6d54 100644 (file)
@@ -90,6 +90,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;
        }