Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090697rwb; Mon, 15 Aug 2022 17:54:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xEpuRaqHyK77B+kZTlq/wXQIsBiF1iIXDJHRwhvbxe8BVrwLOpl+BZSY7vNYBOEChFqYc X-Received: by 2002:a17:90b:1c0a:b0:1f3:1848:591c with SMTP id oc10-20020a17090b1c0a00b001f31848591cmr30038968pjb.24.1660611242369; Mon, 15 Aug 2022 17:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611242; cv=none; d=google.com; s=arc-20160816; b=eL23Mv/CrqXWQJ5BXOaRjyH30KTWORum3aObEC8iT0Sh9Mzw1QGqwBYnza2bIyhMqC ZXH3PFRFiTZWSZXmJK9ejntpLQUCPH+1PbylIZZ3CCMrkhzxEYLz5d+haHkvnFw0GPrX OtMiICDuybwhuMEXVSdBmFLfX6e/F8rAg7XVqV8QBukcYSNX2fG/dmWgC2YM9K7wa8lA InPa/pxqrrT1iDyznuL0fp7rBhVUlCdG7hoGAWnfGJnImxOrPdYMEfRwkDWr24jlsBOD MPL0ejPAUlD4a/YE/V1lqUBTPF1YvZfAdxpkU2D0564/GLmHmvlqd/kPihinRzoP5TFC 4GLQ== 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=cWcGQ45kpJ4Iqni90F9m03/LXTjI+70UNNCp/S7we20=; b=LOgR2F20BbnP9D6M26GPJaSFQH5NNbtXKMB42PI4B2wjXARy+NWnjg31C7HEe7Cy3t I1D5w8klWx1WClXZ+GeZhpJ/SUeeoxAHK5MiAMJDRFHu2ajAqxpI+7K1gre3Gj5WICrn df2KAXEQZowCQAu2P1lXjYeDr67kpcVxNSo7wRzsCMKnQ6q+ftRzDKlDvtd6l9/Ncv/h ZgmaVRFsHuV79jKXNfIZXoaWCRCRTrgzLeTvO1jOw5KRPsxjCJcH8Sq2+E/w/Xfse2nJ TIKnp9AdxuaHzBj0dLK5Nh+rhKh6tzwKk8XSrXE5akgbr/8Mk2Ae6mVP7i5RXTXpRjkG W63A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CBX3QCtK; 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 z11-20020a170902cccb00b0016d2c4d1d1esi11976723ple.218.2022.08.15.17.53.51; Mon, 15 Aug 2022 17:54:02 -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=CBX3QCtK; 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 S1355411AbiHOX4G (ORCPT + 99 others); Mon, 15 Aug 2022 19:56:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354536AbiHOXub (ORCPT ); Mon, 15 Aug 2022 19:50:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 684724D825; Mon, 15 Aug 2022 13:16:04 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EACF960F9F; Mon, 15 Aug 2022 20:16:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1490C433D6; Mon, 15 Aug 2022 20:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594563; bh=5w7u11WAsIHQgPorsHch8FybS1tdF79re+HYY2FLuss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CBX3QCtKZwL3QyYaTYEw5gMYf4ExPHP2MxmW/DtOhIUy2/V+nyCEMfCVK7/inB+ev y812rBtoi3GgtY/uEZUAO+/48lqTnTqnJqCkBqHma1A6Ed7Gr1sgdWTzA5IPppVKFe vBszDnqXrmwD7alA+aP934lI8/02JH/tZ6C1p/9M= 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.19 0488/1157] mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node() Date: Mon, 15 Aug 2022 19:57:24 +0200 Message-Id: <20220815180459.142334805@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 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; } -- 2.35.1