Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909602iog; Mon, 27 Jun 2022 05:34:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ukY7nWtGk1DeCFTx54Lqa6Y9PVHlgdAIVFrAyRSoW4Nt1ZZJFk2MTtRVv48hZNgQAyfxYN X-Received: by 2002:a17:907:7b86:b0:70c:a99a:f525 with SMTP id ne6-20020a1709077b8600b0070ca99af525mr12616052ejc.606.1656333257471; Mon, 27 Jun 2022 05:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333257; cv=none; d=google.com; s=arc-20160816; b=lfkzG6hVtwXxP9dVJcoBaK33B4tZMyb/21Ait38aYvaNp+HC3VI0ckTe7SHGHsiS90 +XMe0/CPeVWaGkm3Mmxk5M7aDGPWXFS/PIBfQxxuNNn+B1fq2JInzz3y4PNGNYTZb1XE l1TeA9DZM+YlQ1KKfZfR6j6S2Ofs+ChAkC+o3nXMqfeQEJFinbnmGGt73q4rARWmkeVk zYYftpq3WyzL4iY0GflhsNyw0L27Ntfz0A7SpSTIRnP+LYsUCUS47CHsdyBHFKcaplvX dekMxYKC2ulh/SrrWQ0MTopLA4NO4hzInhmMgUePoAJVaTFQiDaLVu0bRo4WFxggGWT/ 9/iQ== 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=1q7yc60j7/XqobQSOGVjkiFUTqQxkdX9c/i3mCBZbqE=; b=DQebkF0s6QUSyBSC1PxEUo0zTY0un3MFEupXCgG6/0VEgdeKSZL5ib/5Ykkjx3ZcIl UXEig/g5KzNZWw9Ucf6arjQgDUyJ/Dx2TV+sxQbk1W3+sxKK2mGdgOa2gcDR5crnxLfE CfT1Jgqed49MMh3+8Nglrx0wuazKCSrHmcu2wklDUjYi6uwvZxgIlKbp2BAsFiozpjAU wIUNISD0mnbHKe6tgNXyTIIPpwv+LmDWQES8nFHzXQN4LG1VosQygqdYbccvny3Aw4fP A8cMn4oN8ed8fVAmahQJHahpe6N6e0JoWz0ZATYLjOmp21dCXkOr5gD4GbxGIIe3zDw7 g6qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SJN3S667; 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 o3-20020a056402438300b004359a5259e5si14729608edc.561.2022.06.27.05.33.51; Mon, 27 Jun 2022 05:34:17 -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=SJN3S667; 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 S235390AbiF0L26 (ORCPT + 99 others); Mon, 27 Jun 2022 07:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235100AbiF0L1l (ORCPT ); Mon, 27 Jun 2022 07:27:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 970949FF3; Mon, 27 Jun 2022 04:27:13 -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 3440C614A0; Mon, 27 Jun 2022 11:27:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AECEC3411D; Mon, 27 Jun 2022 11:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329232; bh=+PEY8aTgvCN7a4zjWSNtiwwqaicvZrFgs6faUOWbhog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJN3S667m4HBxOrhN/WQR7pm+9h9kTbtFGMUtYTaa6Fu8sHVZxkRfeAHe3aBRztvI KPslf1/iwurPB+OsipJCzJCz5UXz+EQwO/uJbNSj6lLSeqr4XU1raWXWtz1z6XZFTs eQip5IKJpAvquXotj0C1Br/8Ufk3FR0369dvNI9M= 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.10 095/102] soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe Date: Mon, 27 Jun 2022 13:21:46 +0200 Message-Id: <20220627111936.285730063@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@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 @@ -780,6 +780,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;