Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3025369rwb; Mon, 15 Aug 2022 16:23:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR60lQldcitoRJb1+8i/xC3WmKqu0bXHI8P1qdDYEFkejNRUkm8l/Vkr81wxUV1RXNQgnDq1 X-Received: by 2002:a63:e409:0:b0:429:a62a:3b3 with SMTP id a9-20020a63e409000000b00429a62a03b3mr36083pgi.459.1660605802013; Mon, 15 Aug 2022 16:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605802; cv=none; d=google.com; s=arc-20160816; b=GJLHSamiH70qx/sqgTJn6XIxYNxOqW8YAc92/ek0Gdgg4YBDPRwEzyRqYnyRh5yG2H 0icCYyKJUMegT6x78GYYTq0YXn9KDSgoMB+YAgxSuAilhhr1oRLB5yyh6+5xIwU9MQKJ 6qn3cxajLJU91W0XHQqGR30UCaoP6j+fJ92nJiv80bvPXnTt60iIpHxM6tn43s+OEmat y6VEylqN1eMfSW5JXvYYIXMXtU5Kyj0txlecXfBMd/wLryn0JVb0Rv+mGm881xO6n7qZ bZHuJAciSPBf3q5TvVtS4tpod3/dVTh79LUX/8D1l3OzcfGU2JX9rcNJcK4j+Em/PexI 97yw== 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=Dlp0Aoo9VN2fs9XV4qh5ywz6E/4n/mJBAqN4I2HYkDKVif0RIOwvUfHsyo3pQHZWy1 J1C1tq3I6mei67LM0ITmfUfWb2pKuK3tY5P2aNjOQvIDrsFOaS/5DdE38CqAJc7mpfZj xxR9+cBwcxJsS6joKlq+xE++B+DEwayPQD3/WpZ+PU1U2j5Y1kq9UAR3mk/TzxwcY2f5 eMaWb60COd8LbMCvqNLdBuUZtZEWX6Dbai6IvwPAL70eCr9EMM8INKjMCctwjkOf9m3W +Piph3KBpizfmbwhUil52TojSr7JMw+AE38soZXeqYHTdNB3AAU7MtAnQYft3w7i9lD6 i/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KAye4u1n; 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 w11-20020a170902d3cb00b0017275762141si2078204plb.355.2022.08.15.16.23.11; Mon, 15 Aug 2022 16:23:22 -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=KAye4u1n; 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 S243236AbiHOVPM (ORCPT + 99 others); Mon, 15 Aug 2022 17:15:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347974AbiHOVHv (ORCPT ); Mon, 15 Aug 2022 17:07:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A0F2DAA9; Mon, 15 Aug 2022 12:17:14 -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 33F6E60F6C; Mon, 15 Aug 2022 19:17:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30F2AC433D6; Mon, 15 Aug 2022 19:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591033; bh=5w7u11WAsIHQgPorsHch8FybS1tdF79re+HYY2FLuss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KAye4u1nadB3tBHmTabhQF1HPhawPJtLmtWtkUuW+1Jv7b1VZeyPrv/+jdaXNjwmJ KDnSee6cda7U1Y6sXD3sWhfzvMz2J1W1J0snVPt63A9ddu10a7UF2yfvwCj3OY7eB7 k/tSWQjcCm8AIH/zhF8tmQvIagQyI3cP6LP55ww4= 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.18 0450/1095] mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node() Date: Mon, 15 Aug 2022 19:57:29 +0200 Message-Id: <20220815180448.242700239@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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