Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2908443iog; Mon, 27 Jun 2022 05:33:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vytxCXXyLMl9OmDoqk9uW0GK4CHmaQ4Kb0PU5T+DrqcabPSQh5Irv/wLzRGYPaHNo7GdEP X-Received: by 2002:a17:906:604f:b0:718:e9e8:9d2a with SMTP id p15-20020a170906604f00b00718e9e89d2amr12196454ejj.315.1656333195016; Mon, 27 Jun 2022 05:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333195; cv=none; d=google.com; s=arc-20160816; b=oJ+tbUsxbNxwkltM7AnmQZQlch7IvF9IDfhA5OCQhTm0wuNqP8mqhRrRNxClkYyxY6 0jG4eHoI7N+n/zHyxPrS8RdyEUt1BrdESzM7CvZ0cN2rg82H/oIhmK5A0PH5FbjcoLwe fLr5y0TX5xXvQ6KDyzOwm99C62J7JHP5IIRc1mIg/ZoqwTl9sWVpUdjLINqzfmR4lRAC 4VARJ/lp/AsMd+0lR09iNsRe3hdrmluvjSFwOluY0cDEys877AjmrGwZn69T3L4q/qdH qoeazKX3aA8xnQiLAtqGDQLYqJDYFWIB1rFFTVF3LOTomqoEpB8Vz3jHCIHJdsXzsfle pWzw== 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=jL540v4hjFzuu5Ea4uozaoyDEwEbQ9O2SAP+4eTjpss=; b=xy4NIRU8iKlg9PbvJOeiO4SDJQ4gOj6hbNTMvX0S6SXej5v36rcERYgZWugmfL/OPO KRhyEkAzzImIAN5ZIAijB4oXTuHC8CQV7D0HaiUR7uUpQcbZUQFGXKBJqnsGCv7wlL3u 9sxYZ1ON2D7W1zkcQNkzZJdVGrega1m+AcsOD6WPxePLpihcphFna0hFykUFX5BPlnJt sqjVdBlOIy6A7FGiGtbdWT9BLbEYbCPt17Hqh6Ye5sZF86gb8AFMGDCUVs6PxvD10g8F aWrBWKFGEw80/Jlyt/ruPZghu2QYIL8Dekm34Lc71t832cPjb4OxpUmMjrqIEMcH0amM dadA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tu+wE2En; 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 18-20020a508e12000000b004357cc6877dsi12807832edw.202.2022.06.27.05.32.50; Mon, 27 Jun 2022 05:33:15 -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=Tu+wE2En; 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 S239476AbiF0L7t (ORCPT + 99 others); Mon, 27 Jun 2022 07:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238840AbiF0Lwm (ORCPT ); Mon, 27 Jun 2022 07:52:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A52C5DEBB; Mon, 27 Jun 2022 04:45:53 -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 41C1E61192; Mon, 27 Jun 2022 11:45:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A90DC3411D; Mon, 27 Jun 2022 11:45:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330352; bh=j9qNbIV5qykTmfb74nTj6QNsbGZq+ysCLwQ6Ymh4+Ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tu+wE2EnVQwNhqPEnx+pKfG01kDr82gj13Qw/FGT7HeIDRO5RIBOIMYapyvqOgTt9 0J9tfu0hsqE5AylGwE/TqQ4XvCZwMoLNHG/2GmhPUOzRcddrzR7Pfc/yieP9nEY5lZ dOFUyUgG6m1t9J+XiG1StTNexWhMSfmAQswWxPVk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Andy Shevchenko , Florian Fainelli Subject: [PATCH 5.18 168/181] soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe Date: Mon, 27 Jun 2022 13:22:21 +0200 Message-Id: <20220627111949.557099893@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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: Miaoqian Lin commit 37d838de369b07b596c19ff3662bf0293fdb09ee upstream. of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. In brcmstb_init_sram, it pass dn to of_address_to_resource(), of_address_to_resource() will call of_find_device_by_node() to take reference, so we should release the reference returned by of_find_matching_node(). Fixes: 0b741b8234c8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)") Signed-off-by: Miaoqian Lin Reviewed-by: Andy Shevchenko Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman --- drivers/soc/bcm/brcmstb/pm/pm-arm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c @@ -783,6 +783,7 @@ static int brcmstb_pm_probe(struct platf } ret = brcmstb_init_sram(dn); + of_node_put(dn); if (ret) { pr_err("error setting up SRAM for PM\n"); return ret;