Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353939pxb; Mon, 20 Sep 2021 19:52:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymuxd48dOf8vcPVZNcqKWqjjDBfNGQE6a+0kgsOUS8PPOglO9vFZ/Ftzko7T/h+5t3duAo X-Received: by 2002:a17:907:98a5:: with SMTP id ju5mr30242875ejc.378.1632192772177; Mon, 20 Sep 2021 19:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192772; cv=none; d=google.com; s=arc-20160816; b=Aqe/jGOmg9ZouQe5ZXsxHVWC7KBGw9AYQjxhpTGybE3guyTi1J2ZTXbjDxhO2i77rv i9RqKJD8lFlraatDawvLdM0YydOgVjdG7LuIrI8APu8hbgzcUx2OGImj5qAvuLpqohHN ZK7FBbGTs65R8LCtntiYh644TT6tyBWN6i0D69KTt3MXRuAbr6Riip30fZHu6M0H3f31 uIyKkzkSNR1yS0lqRHGCuE3uJmniX3fFg7PelULNcAflxFt6zEc6rN/cAmQ2BJhqo+3b Sm9kCBY6/Ou1iBC3/suU/YTEbc8L/WxE5xy7jokZuJAsRKBDwzxbhzRqYYCszP5X/B/+ 6zAA== 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=Xztk5FK8y9aLjV6Kszh8K5Wn16tvFFiHlJkOjNUVhA1QWihpOtCkNbBxIpS/AznDzn D5yceihFm+IoRJM3azOymlqCiTBR6gJayMgoY8ieoVwIJxCMDiI4GyUAK1wJE5bwKYqa uf/12NjBados5eyMGOhY4ovKucX73mCQuxraMa4YQM7p9gJB7eGJ2wca3nmGkCTWuccP reBHTM2vb8GMRxsl+M4SApn/JbtVbFPBc8lOl38znmK76KpkyeBUDPBOftbifDQR9Ayv 64BScbOsRj8BFeYnHzkEfLCpWRzg7TB9GkjqwYAh99jcZ9xXE3yr4Dpuhzf+72IegvjV KhmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DhE+ehgz; 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 w15si15248574edl.407.2021.09.20.19.52.28; Mon, 20 Sep 2021 19:52:52 -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=DhE+ehgz; 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 S1384965AbhITStY (ORCPT + 99 others); Mon, 20 Sep 2021 14:49:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:33540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384094AbhITSqc (ORCPT ); Mon, 20 Sep 2021 14:46:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 86C3363365; Mon, 20 Sep 2021 17:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159218; bh=6n8ZrpCjHK/0owdGbK700/HKwHqdWGyYWY9zC/fI8/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DhE+ehgzp2Cpx0ugOkiBf0ezfHmkvLJ1RZxvzSBMvyFekkbX/zUeKKjIOjmzqPUNu U7xV1q7h5GzwTMgYGBx4ELp8LoRv4vPwgTpsbBFXAJyzL8qZBxaRhw+FH8Ix2h1R0Z PPb4nbPU7b7xJzUdJVK0Rnpmm5Li/ld4YCd5c2PY= 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.14 099/168] PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe() Date: Mon, 20 Sep 2021 18:43:57 +0200 Message-Id: <20210920163924.891453310@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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