Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1398044pxj; Fri, 21 May 2021 13:15:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyQuUFtKPogoLJCUAvUYRQD8gkv+aDzq2XtdHTuGYguasaeail8ieQeCmGDTe6w3+9Mwi+ X-Received: by 2002:a6b:ed11:: with SMTP id n17mr505759iog.171.1621628142140; Fri, 21 May 2021 13:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628142; cv=none; d=google.com; s=arc-20160816; b=pN07sOhhrjlZxvWvBeKdhFnBrDFsTC9cOYHdiqd4c8CSJVVYrQ8P/4S7+YO8H9UR0p tX/pzHVXdRQMMjE1A+sj7AunsVBtde+/q7O5x0eYCNALsXEEzvIRDyU8kYQBqiPVicQ4 V72NLBSLIGYYapOasCspOTXXQA8Ji6Ld05KboITC+qW9XmNRdYOjYkgON8KMkFTsYER2 vJwONeF4eZ1L3J7v/+JMj/tkCmVEgJnwnr6JptB4j1Yr3E1winNnPtfRSjXc1B25OFjj lqNTloeqd8RQjyh4CmEop1KU7vf/4T2melj0Ydh+NF+hyKMo2lnbArUf74hFLS/+OQdF z2cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=JnjUS9Myrubh6tkpHKaIS/lt3Aadx24leCnjvPhJJvs=; b=bl7HJBPJD/2P5PLe+a9bwmslaYqGxVJHqef6Ko3jTCMoA4m/lth9DxIkMmpta878tU LnuQSIQRannuCbaa8vpoF2ZjrAdtay0QViaN7Lpyi56NOlybxjVXP7RUeza0k1yTgTBM kqI/Rd8XYBnA3uiLaYr2xLYJKFT4/GQlABAG1ddu3QwAt8P9vSOjI5CHAYXo0MI2zr3j 1xsTcDbCBi2HfPhMSSKH+jAMnKCkSv8yPO9Mg0jEaTcaFKyS3pdYmQv72OXjZwKN9Q9S HonI2VtjAhPIrKTQEG9fGvqnnM/YTL50enWsmBlWqRhJeLi480iAlsouiunVOqFYK3V1 tpBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si7132662ilf.140.2021.05.21.13.15.28; Fri, 21 May 2021 13:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234121AbhEUMsh (ORCPT + 99 others); Fri, 21 May 2021 08:48:37 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3620 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbhEUMse (ORCPT ); Fri, 21 May 2021 08:48:34 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FmmVx4b81zQqdl; Fri, 21 May 2021 20:43:37 +0800 (CST) Received: from dggemi762-chm.china.huawei.com (10.1.198.148) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 21 May 2021 20:47:07 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by dggemi762-chm.china.huawei.com (10.1.198.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 20:47:06 +0800 From: Zou Wei To: , , , , , CC: , , , Zou Wei Subject: [PATCH -next] PCI: rcar: Fix PM reference leak in rcar_pcie_ep_probe() Date: Fri, 21 May 2021 21:05:54 +0800 Message-ID: <1621602354-109955-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggemi762-chm.china.huawei.com (10.1.198.148) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/pci/controller/pcie-rcar-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c index b4a288e..8a8c46c 100644 --- a/drivers/pci/controller/pcie-rcar-ep.c +++ b/drivers/pci/controller/pcie-rcar-ep.c @@ -492,7 +492,7 @@ static int rcar_pcie_ep_probe(struct platform_device *pdev) pcie->dev = dev; pm_runtime_enable(dev); - err = pm_runtime_get_sync(dev); + err = pm_runtime_resume_and_get(dev); if (err < 0) { dev_err(dev, "pm_runtime_get_sync failed\n"); goto err_pm_disable; -- 2.6.2