From patchwork Mon Jul 4 08:34:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang He X-Patchwork-Id: 12904842 X-Patchwork-Delegate: nbd@nbd.name Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6002C43334 for ; Mon, 4 Jul 2022 08:35:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231771AbiGDIfh (ORCPT ); Mon, 4 Jul 2022 04:35:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbiGDIfg (ORCPT ); Mon, 4 Jul 2022 04:35:36 -0400 Received: from mail-m963.mail.126.com (mail-m963.mail.126.com [123.126.96.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EA8D3B493 for ; Mon, 4 Jul 2022 01:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=FJG6V 4jph5sUNRiak7lEZgEto/bDbMAVj1LGzxQ4h9A=; b=iN5ba/iD0D7W2aUp0RxvL 6JY/aLphkeo4i3b/rILBYLodVQf4zg73ZUrkcoEioeNPjgBYMMc/Lx+KTaqgI2c2 zSCf3zwWrP6tc7/PKg8SZ7/tPX700mdkuu61vKQWJBHjN6ROUheCu6xFvVoWgW1N qL5lpp6oO3dgPa1mNOabE0= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp8 (Coremail) with SMTP id NORpCgAHZZkSpsJidprJHA--.17231S2; Mon, 04 Jul 2022 16:34:27 +0800 (CST) From: Liang He To: nbd@nbd.name, lorenzo@kernel.org, ryder.lee@mediatek.com, shayne.chen@mediatek.com, sean.wang@mediatek.com, linux-wireless@vger.kernel.org, windhl@126.com Subject: [PATCH 1/2] mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init() Date: Mon, 4 Jul 2022 16:34:20 +0800 Message-Id: <20220704083421.276727-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: NORpCgAHZZkSpsJidprJHA--.17231S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruw17XrWkGw48tw4kXw1fJFb_yoWfKrg_Wr n29r17XFyktw1Ykr42yr4a93yFkFWkWrWxJFZaqryfW3y7WFZ8Gr4FvryDJry7uws293y5 Gw1DGF98AayrZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRJGYdJUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi7RM0F1pEAVUTQgAAsG Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/net/wireless/mediatek/mt76/mac80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 18b5de55334c..e1708eff9186 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -210,6 +210,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);