Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2927410rwb; Mon, 15 Aug 2022 14:12:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR7NcoGuBCBDE1LW56BOcE+LnN5rPYubHypHjLt+c/gqcr0xkZrpOYIS4GUiBI36RtwM6Kvl X-Received: by 2002:a17:903:50e:b0:170:d829:b3bb with SMTP id jn14-20020a170903050e00b00170d829b3bbmr18434982plb.93.1660597970859; Mon, 15 Aug 2022 14:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597970; cv=none; d=google.com; s=arc-20160816; b=0lXBQv0CBdTLpCYLEIT2IM2KLmo3AbZnqnxuQksu+qd9poQ4a8O9Eq+8LwQH7S+6lA LwBw+XwVvOC0szelxhZQgdfMQh+ct4GluhvNqsTA7c/J5ahHZ7iDxCXlEfc584iB4WX/ SxtVhUvIYmbvOHwIPggwCEuzBt+gPBsjgHcgyvmP6an+jADOmtpCYuBWygRaFtOnLxXw SAFofUEXX03S4GEBo0rlh1SxlmoHDGDCVZnqdCiMCYyfhMIokwoJ/EeC+4kjwT/gKAa7 +j4tKz4X5UMmldsz/j2bLEFfSCnHvgOoinNlYMK///VcUSGUjbS/8VIfmN60Rw4/GYtk VQOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9VidLDbGWazPhFyn9jjpbHVtdN/1dFhSxOvqpZg/xRY=; b=opMUjEqh2tyZ2KalKPE3qAvFcG7LNViC3U/JvxGa4MDeyY/l7vwCN/jD5rnmmRq+YD CE951RbsDL2G2feieYToVirVFatIvXivFfxGAau6BqQWmMYwben+EujEYyxHCJWuIusc CTUnvf8bqIS0tewV5hDdOwFJl/8uQFqbFm0gYeG68otnIKe3p2wOhv6lvFP0E275Ly2G Iy4U/Fyrp67Teo0OydrKPfRZuY7q2I9r+LIjYkc9afwDQ6Nl5bUZEQCtJFDoCbOpgad1 c0qaffuO4XViOQTrMyZH/Vz+CBNs2NaqnQ0Z08qwe3xxsVq3qVGniNEh0VNh2Zy/InQG yEpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=abxF6zHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix1-20020a170902f80100b0016d9e2b9a0fsi10667826plb.340.2022.08.15.14.12.39; Mon, 15 Aug 2022 14:12:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=abxF6zHl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245216AbiHOTBe (ORCPT + 99 others); Mon, 15 Aug 2022 15:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245157AbiHOS4w (ORCPT ); Mon, 15 Aug 2022 14:56:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C89B32DBB; Mon, 15 Aug 2022 11:31:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CECF3B81082; Mon, 15 Aug 2022 18:31:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 053A9C433C1; Mon, 15 Aug 2022 18:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588312; bh=UNse/8MvXDfLtiLsFDhl/AJsP8hoheWPNg98s6jZGdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abxF6zHlVgj2Md8Kd/Jk2TmmxKYxhaFPe169wY3AgtaA+Cj8w9/HeIFbww7dItNE6 KdcJrr3wikOzN2LLWxWIGxnLWETJP4XWiHHEF6F+H6u/oTYKIGlMr/Re2DglE0r2u3 5Lv1df24yXD/r8nYaNS3fwiRxDuDG0PlKmfXLBJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Felix Fietkau , Sasha Levin Subject: [PATCH 5.15 332/779] mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node() Date: Mon, 15 Aug 2022 19:59:36 +0200 Message-Id: <20220815180351.473557798@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liang He [ Upstream commit 3bd53ea02d77917c2314ec7be9e2d05be22f87d3 ] 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 Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- 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 3b47e85e95e7..db0cd56c8dc7 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -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; } -- 2.35.1