Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2662186pxa; Mon, 17 Aug 2020 15:52:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0aa3JS7Jus2yluAIRXI/uni+wU+9TeBC7TR4PexwDPvBSX3WLOdOAkp0S7xmBoowVtzxC X-Received: by 2002:a50:9316:: with SMTP id m22mr17693579eda.178.1597704773781; Mon, 17 Aug 2020 15:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704773; cv=none; d=google.com; s=arc-20160816; b=OOH1SfUDiPoImca/bFHn/4AsWejM13o+VBccNqWG8+fYAJBSNrkDmxXvrJw1HqJJ90 a3UR7bhFe1XzWjkmGKCticdSTEqkNVqDAaKMmObB/m1kM0cCwEtvu5PMBr6yKS+yrG7F MuwAjyER4+gbRFhA2qqlfelEZsQGi0AJR91YpS4BfdxnCViaRE6DjFeTfyWeWzjosl0T fP6L4NdME+elQuKpLm/R4DSu9NMFWQ8dFrVG/pMBl/W9cFKr28VSRMZeLTqt5lNjWPd/ 3gR0wH5yb2FzRq8wNmxwc8r0GdQxpFa6Bx5s0WQSo4wZDqsQYT1UKh6Vj3k0nu5FiGjb Fchg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sK/a7nuwLH8sJxYuJ+Iy5X0aIfrmeFETliHs7uByQpI=; b=AW1EiSL1R5Vsjf/Pt2+Mpg13NO5nUwZLF01JVUBqeLQZe18WFBLgkuZdzLMjIlm8LC C+F2e+BE/QmOrd1UaNxZfjmDtqgXGptAReOkpGblDFuWnIOsMh/rDmEAWAaArJhCKT9M 2SaT1sGhyEO/4nWVfV0+4hbxjWL7COcHMQmW0JeYlitA1zMevC7IUAvQXBCwPAtr0uOZ n2wZooNPgjA//5VZsJoT6OsYh9Mc7d2QvfWivZ+0h1op1xh7Sr2AjML8dK03Cgf6SpOw hHn/hnbp2EH+2NCNk1BhM0eyvAPG8RJBH2jdJjXD5irUbRKisW0m5goNqGQFpL8LbFg/ 2yPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cHFwHzwj; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si11987833ejd.623.2020.08.17.15.52.30; Mon, 17 Aug 2020 15:52:53 -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=@kernel.org header.s=default header.b=cHFwHzwj; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732140AbgHQT3f (ORCPT + 99 others); Mon, 17 Aug 2020 15:29:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730314AbgHQPcQ (ORCPT ); Mon, 17 Aug 2020 11:32:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5968923125; Mon, 17 Aug 2020 15:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678335; bh=Xji4J+FpRs9JzraOZWkDixn6ptwTmp3//zbyAFyKBIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHFwHzwjzM7k1wslISzy6Oow1ogXvpr8ARA6+122p2wMdjyL+QYDDhrBfTh6I2X2m aFxKip9bF1At3LluG5qiykv8qJPtT9mBBSg5mHUkYiEUNmCoyaCdBGC9Wi1WY5amd3 GmCtqshVadVlzC0/CnR3g4IN0s85HP9wv+fBiYHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Sasha Levin Subject: [PATCH 5.8 299/464] PCI: cadence: Fix cdns_pcie_{host|ep}_setup() error path Date: Mon, 17 Aug 2020 17:14:12 +0200 Message-Id: <20200817143848.129941592@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kishon Vijay Abraham I [ Upstream commit 19abcd790b51b26d775e1170ba2ac086823cceeb ] commit bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library") while refactoring the Cadence PCIe driver to be used as library, removed pm_runtime_get_sync() from cdns_pcie_ep_setup() and cdns_pcie_host_setup() but missed to remove the corresponding pm_runtime_put_sync() in the error path. Fix it here. Link: https://lore.kernel.org/r/20200722110317.4744-3-kishon@ti.com Fixes: bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library") Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 ++------- drivers/pci/controller/cadence/pcie-cadence-host.c | 6 +----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c index 1c15c8352125e..4a829ccff7d0b 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "pcie-cadence.h" @@ -440,8 +439,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) epc = devm_pci_epc_create(dev, &cdns_pcie_epc_ops); if (IS_ERR(epc)) { dev_err(dev, "failed to create epc device\n"); - ret = PTR_ERR(epc); - goto err_init; + return PTR_ERR(epc); } epc_set_drvdata(epc, ep); @@ -453,7 +451,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) resource_size(pcie->mem_res), PAGE_SIZE); if (ret < 0) { dev_err(dev, "failed to initialize the memory space\n"); - goto err_init; + return ret; } ep->irq_cpu_addr = pci_epc_mem_alloc_addr(epc, &ep->irq_phys_addr, @@ -472,8 +470,5 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) free_epc_mem: pci_epc_mem_exit(epc); - err_init: - pm_runtime_put_sync(dev); - return ret; } diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 8c2543f28ba05..a1c6bd6f87c51 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "pcie-cadence.h" @@ -250,7 +249,7 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) ret = cdns_pcie_host_init(dev, &resources, rc); if (ret) - goto err_init; + return ret; list_splice_init(&resources, &bridge->windows); bridge->dev.parent = dev; @@ -268,8 +267,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) err_host_probe: pci_free_resource_list(&resources); - err_init: - pm_runtime_put_sync(dev); - return ret; } -- 2.25.1