Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353181pxb; Mon, 20 Sep 2021 19:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiRGEcGijvy9Xb2LRPuTQB8IhN6sp95j+7wPNhLE3mpCgrlD8gitT8Iv+BAh8tw3WZs09F X-Received: by 2002:a17:906:4f19:: with SMTP id t25mr25570402eju.440.1632192665405; Mon, 20 Sep 2021 19:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192665; cv=none; d=google.com; s=arc-20160816; b=lRN5se3ta+AUY3CGIN4+bpGXThQwkCQu57xXEQ06QO71Flr+uoQHBf9rWC5HFeLKrW TPLFuBfSG8YmPCII80BZMvenGBa/m0D8j25QYqD9uQuEOtLp7+4VoLWFHN/chd4T9pu3 dZpl6DC7IXYwkBj85Sgq/jMbekDl/AVa6dO0CE9yuHlOzCBRpPe8NRpz8MOUg367nn28 GkmLSIN/rWZ31g1pcf4YLf0uCLsxj7waC+XIu/TLx3hyoD3Z+oO7KCbr8QfFgnILWlGv sdKt+uy6FeRLVQRJtWKCkCzaBg6gyQuyLRjewiibjHP5JyfP6HMQ/V5w6NOL/aeT4bJA GdjA== 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=dSlYDdcx93jIaY+9EtV3MtuB/e72HjzRVjHPYvZ4zFQ=; b=IPG+UPzuO5XNZoDgMBom7AaU7GizevhMa+yDRjmQ1QjqT1mgB1H3V1vnmjXUfU3gB7 SCpJHGeYqPTOYXnPMCitEeQ7YRGe7SVV+wINg67wAJuNpb2EBsiTs5tyjGFxLNHfxcWl oL8YMUIHZ6HI4ZF4Nq71JcQj3hqXjRnkAkFgpRZqUEZf3RmDOgvD9JU+w8uhVheph0uY pk4TqghWhC+cahzPw3KgO5Mk1chYYcE+mNKA4QymZhJbLShiNF8RIwrbx8IGVgr9tpxO WrIjsRtsWReGSeW5wesyLTo1R9G5BdPKGpL4btqxhKwbEAjpPpJQTIysr3Oy3MIFpQ5F 1FgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=19vpbNQO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id my11si17258695ejc.350.2021.09.20.19.50.42; Mon, 20 Sep 2021 19:51:05 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=19vpbNQO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378917AbhITSh5 (ORCPT + 99 others); Mon, 20 Sep 2021 14:37:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:49306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380108AbhITSce (ORCPT ); Mon, 20 Sep 2021 14:32:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 84C9D632FC; Mon, 20 Sep 2021 17:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158876; bh=6n8ZrpCjHK/0owdGbK700/HKwHqdWGyYWY9zC/fI8/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=19vpbNQOYbT7J/RnxDr+eZQ9RcJzrfWsi5TZeG0HF/80rs91pmYbrFwenYO+LrifW YL4j227TC6DdUyCMji04YMSvocpDjkTC5y53lShZ5qippE9F06IAIMS5jUDiXE5uF2 jzbyYEEMm3s9WiDE4xHRSwW4F8R32MNqns8a7WnE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Lorenzo Pieralisi , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.10 063/122] PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe() Date: Mon, 20 Sep 2021 18:43:55 +0200 Message-Id: <20210920163917.845123248@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 1e29cd9983eba1b596bc07f94d81d728007f8a25 ] pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Link: https://lore.kernel.org/r/20210408072402.15069-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-rcar-ep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c index b4a288e24aaf..c91d85b15129 100644 --- a/drivers/pci/controller/pcie-rcar-ep.c +++ b/drivers/pci/controller/pcie-rcar-ep.c @@ -492,9 +492,9 @@ 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"); + dev_err(dev, "pm_runtime_resume_and_get failed\n"); goto err_pm_disable; } -- 2.30.2