Skip to content

Commit

Permalink
mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_…
Browse files Browse the repository at this point in the history
…limits_node()

[ Upstream commit 3bd53ea ]

We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.

Fixes: 22b980b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
windhl authored and gregkh committed Aug 17, 2022
1 parent f646d94 commit c4ff3ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/mediatek/mt76/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,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;
}

Expand Down

0 comments on commit c4ff3ce

Please sign in to comment.