Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197160iof; Tue, 7 Jun 2022 22:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6IWDW4kWPznSstmUu94ZiLJW9pdYXjoTcH8OuNPoDEG/KAVPTSQc8So+BKQiy+ttO/WGK X-Received: by 2002:a17:90b:1e04:b0:1e8:4a47:966d with SMTP id pg4-20020a17090b1e0400b001e84a47966dmr24539594pjb.51.1654667751356; Tue, 07 Jun 2022 22:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667751; cv=none; d=google.com; s=arc-20160816; b=tPAFsaXdjDNEYu7qZ2tDO2ZRpdZM8H9vTMk3AlGIbdT0QRY/4Z8axjXYqMBWe0r+/e /OTpWmUHStUitrE+h8cRizPJVrEGC+gp4FwiISiYY5znzaaJkw6Ig3E2LC23OIvoIXS9 vTulMtBbPqLF1Hyius0/xNwwyFDnAZr7MFDaOXGlTmwXQTSVzkPeKona7wNxnCu/ogxF d7Vpq59vmDdSkGk21jRwgpP1vIwFB+7lb0S+RRvC86A7aVffA74FneyZGmoEs48aQUqF +CogEOW7prEUeBPkbDze+DbfRgEW1QcS+vy/ZPR2vEm8XJuGd7ZZujEOO7/QoSgzykYK voHQ== 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=f7AfmJIYz8sUIV7Optxy2WOIf8ojN2rCUAtpxAGva6g=; b=wpzyGlfwArG1ommv1jxGUyw+TbiVAfI+pfxOLXUuD7BhObtzhRWrV+fVkHTIrZHuEi sROL4ZlUNHzmk+X8e63qkIG6e/FXWh6fCzJafYPD4pwVjMfRnBkc7ddi1E9EMsuY8E9G oQAZkCO3MEyU59xShWNuNHWK1ghTKeGoN9/OhWptcvLENGJyMRX0JEwkgfco+zm+Gfq6 AvPpSdWCUSntn5zXFtBupN9CzBTP9l58NGZa+g/w5hMV7wbJSNdNumRN7nSSYawp31Hk EXsltN0tZ/iawKI1TEDkQ77WPByd8wK5YtoNCCvKS9f2CFJZ/+djFUa/ldx34uk3AtNZ dR7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLv9Sbug; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x17-20020a634a11000000b003fe2a0502c5si1225809pga.455.2022.06.07.22.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:55:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLv9Sbug; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C6A65158962; Tue, 7 Jun 2022 22:22:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443185AbiFHA5q (ORCPT + 99 others); Tue, 7 Jun 2022 20:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383249AbiFGVw6 (ORCPT ); Tue, 7 Jun 2022 17:52:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CA12431B6; Tue, 7 Jun 2022 12:10:51 -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 DCCD361846; Tue, 7 Jun 2022 19:10:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E85FBC385A2; Tue, 7 Jun 2022 19:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629050; bh=e7z7YYVlH1TL5GP3G+nujeATCGzehNUWZSCRno86fts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uLv9Sbuga5pyhfpXNTaHfGWtQqvTvQ35QI+55NbT9NIsbyj3tlGsmc4WNTfYvwg/B 0HcwMHJhTzQUx5xstON866oENR+zQhgWV0Wop54FsNPfdzjBsrwP/jlVTT8IY4RJs6 FmMcTiB3r4d74CGfsADZx7Iiy33xdfnyEkE+avu4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Lorenzo Pieralisi , AngeloGioacchino Del Regno , Miles Chen , Rob Herring , Sasha Levin Subject: [PATCH 5.18 544/879] PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup() Date: Tue, 7 Jun 2022 19:01:02 +0200 Message-Id: <20220607165018.659861326@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 [ Upstream commit 214e0d8fe4a813ae6ffd62bc2dfe7544c20914f4 ] The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Link: https://lore.kernel.org/r/20220309091953.5630-1-linmq006@gmail.com Fixes: 87e8657ba99c ("PCI: mediatek: Add new method to get shared pcie-cfg base address") Signed-off-by: Miaoqian Lin Signed-off-by: Lorenzo Pieralisi Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Acked-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-mediatek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index ddfbd4aebdec..be8bd919cb88 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -1008,6 +1008,7 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie) "mediatek,generic-pciecfg"); if (cfg_node) { pcie->cfg = syscon_node_to_regmap(cfg_node); + of_node_put(cfg_node); if (IS_ERR(pcie->cfg)) return PTR_ERR(pcie->cfg); } -- 2.35.1