Skip to content

Commit

Permalink
mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init()
Browse files Browse the repository at this point in the history
We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.

Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Liang He <windhl@126.com>
  • Loading branch information
windhl authored and nbd168 committed Jul 11, 2022
1 parent e6c6bf8 commit 120f73a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mac80211.c
Expand Up @@ -216,6 +216,7 @@ static int mt76_led_init(struct mt76_dev *dev)
if (!of_property_read_u32(np, "led-sources", &led_pin))
dev->led_pin = led_pin;
dev->led_al = of_property_read_bool(np, "led-active-low");
of_node_put(np);
}

return led_classdev_register(dev->dev, &dev->led_cdev);
Expand Down

0 comments on commit 120f73a

Please sign in to comment.