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); From patchwork Mon Jul 4 08:34:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang He X-Patchwork-Id: 12904843 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 602A8CCA479 for ; Mon, 4 Jul 2022 08:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233337AbiGDIfh (ORCPT ); Mon, 4 Jul 2022 04:35:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbiGDIfg (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 EA838B484 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=l1t1B jKcaNds6H6upcvrVgJe3EiI8pwcuA8sdN9vvyg=; b=Tm+7ACJ1gbLTGc88970MZ CQWYVyg0336/jCku5DrIeuf0F8fm6iOc+83i15f2YquFtBTe7gASuTa0giz4kiv7 NhPuRRmEVxm/9Q9CusiylzdEYCDE1TF70Wigqan0ikCQqFWdrvcLX53Xhg9qX2pa kJsKV+0ICC8U+DlfwEp3rM= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp8 (Coremail) with SMTP id NORpCgAHZZkSpsJidprJHA--.17231S3; Mon, 04 Jul 2022 16:34:28 +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 2/2] mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node() Date: Mon, 4 Jul 2022 16:34:21 +0800 Message-Id: <20220704083421.276727-2-windhl@126.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220704083421.276727-1-windhl@126.com> References: <20220704083421.276727-1-windhl@126.com> MIME-Version: 1.0 X-CM-TRANSID: NORpCgAHZZkSpsJidprJHA--.17231S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruw17XrWkGw48tw4kAr15XFb_yoWDJrX_ur s7WrnxJF1xKr10gr4jyFW3ZayIkaykJr1xuFWIqrySg3yayrW8WFn0vr9rJr9ruFsavr15 Jw1qqFy5Aa9a9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRLF4iUUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbizhQ0F18RPbX8JQAAsm 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: 22b980badc0f ("mt76: add functions for parsing rate power limits from DT") Signed-off-by: Liang He --- drivers/net/wireless/mediatek/mt76/eeprom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }