diff options
author | Liang He <windhl@126.com> | 2022-07-04 11:34:21 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-07-11 14:40:03 +0300 |
commit | 3bd53ea02d77917c2314ec7be9e2d05be22f87d3 (patch) | |
tree | c1bf6f9994ed69ee9d2fff8868c9046ddeb24d64 /drivers/net/wireless/mediatek/mt76/eeprom.c | |
parent | 0a14c1d0113f121151edf34333cdf212dd209190 (diff) | |
download | linux-3bd53ea02d77917c2314ec7be9e2d05be22f87d3.tar.xz |
mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node()
We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.
Fixes: 22b980badc0f ("mt76: add functions for parsing rate power limits from DT")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/eeprom.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/eeprom.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index a499861918fa..9bc8758573fc 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -162,10 +162,13 @@ mt76_find_power_limits_node(struct mt76_dev *dev) } if (mt76_string_prop_find(country, dev->alpha2) || - mt76_string_prop_find(regd, region_name)) + mt76_string_prop_find(regd, region_name)) { + of_node_put(np); return cur; + } } + of_node_put(np); return fallback; } |