Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2585426rdh; Mon, 30 Oct 2023 01:21:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpGWgbRlVL/tjCAm74uFyBlV7eLLH8GyDS6/9b1L7WM2WImrb2n2hPN9+q7J/x+pdAN7Yn X-Received: by 2002:a17:90b:1904:b0:280:16bb:8169 with SMTP id mp4-20020a17090b190400b0028016bb8169mr3935815pjb.40.1698654118016; Mon, 30 Oct 2023 01:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698654117; cv=none; d=google.com; s=arc-20160816; b=iiuqhJkfLVrkBiMeBvRxZRYrPwswUnpA/Nx/lbvJLbDlGXU5lCBBOz6fGkt0jVAniy 97ufHjU2f6Pbw1IuFc3EyjXsKnkrcDjZvp6+tw285gKL9HujcOnSZPSQUlxM8DPm1+bo AilkWtraXgGjElU/hKNrfL6rAhzMPGTX8c+oUW3KB/ijG0HrmkGQWynY7IZv8OxJfGy0 CaRKGJOVmyYvRZZSTISlx4mRyN2Y2cDyPZjdPahIujfphC0nBhNNN1mT34nAtrgO+wUJ ckZZQamHWNtfWo9FnX033SZPUr2iqOdPPiW7Jf5tuOTBcByayib6DGU5vXnFZdla1Cch 7JSA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3VXcFUM59+a6yTHwvN11t3YSHRRSpkC7ssA2S+DiK0A=; fh=+P/RXkrEsz+aau1A+coJFqwXvz0rvLPAPQ8TEg7cdCM=; b=Jd7AegXbGFoENplHRsI4dp3tUp5aORePNvDE/iRxEYC03fzNhKwL6RUiX2GA/Lynf7 yvt+tpEkQdzEUFC9Hy/HN2lcSYhlKpZ/6sbEDdxzsge5k4kBFkKKYDA0rOW3yS/GbYFv brWgVKSw8QuWo94rubVXC1BtqxYN6VSDK46Hap72ZwACJKTC1kqtcSH8kC85q7bw/28d 7Ct9cMOqm6w1UJ13jMfnLjFSRm2l1EnPV6325uljYuU1mlB0rgYLAs6RcpHtTRNWeOFL fzTv2f5UYEtk4VbvTCzM8FyCl7rIOeJ2oXpREMRhMurTGZiRGv3ZzRUD8t6w4cjtvoM/ kDVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ciL54POF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d4-20020a17090ab30400b00263eb5054f2si4523889pjr.105.2023.10.30.01.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 01:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=ciL54POF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 01B5080658E9; Mon, 30 Oct 2023 01:21:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232062AbjJ3IV1 (ORCPT + 99 others); Mon, 30 Oct 2023 04:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjJ3IV0 (ORCPT ); Mon, 30 Oct 2023 04:21:26 -0400 Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34CD5AB for ; Mon, 30 Oct 2023 01:21:24 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id xNWPqRZ1MjwlwxNWPqO2Tz; Mon, 30 Oct 2023 09:21:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698654082; bh=3VXcFUM59+a6yTHwvN11t3YSHRRSpkC7ssA2S+DiK0A=; h=From:To:Cc:Subject:Date; b=ciL54POF1xrD14QUPwx63HiBkJ+cEP0l2VpgVDg3lFrzxGHyfqFCb0gB2cWTngbYn adEOjMR4CO+GetQgS2K7cEDJ5z6owMmJQfCiVW7UPEXE3kmCR66jnscVIhNmyXE7W1 afgzgw4TZIYIsUbEAl2qSZAleAvmcyYcj/dbEX7nLaOcp/pmpQnby+UIoE8IAg2Rwa KqqVYhRcN27pRTluiVb5OLQ9yxw52kvvKtXwk+rsTJlEg0Jvyjy4z7m2tIZtv2CFbQ vo9CHWbhgQMT6GbDk7llatDHmUE38ivu79aqtkdjDff+648jJLi69Gvcg53Ts6IXD1 R+H0U1u1U9LsQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 30 Oct 2023 09:21:22 +0100 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Xiaowei Song , Binghui Wang , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Jingoo Han Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org Subject: [PATCH] PCI: kirin: Fix an error path in kirin_pcie_probe() Date: Mon, 30 Oct 2023 09:21:16 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 01:21:31 -0700 (PDT) If an error occurs after a successful kirin_pcie_power_on(), kirin_pcie_power_off() should be called, as already done in the remove function. Fixes: fc5165db245a ("PCI: kirin: Add HiSilicon Kirin SoC PCIe controller driver") Signed-off-by: Christophe JAILLET --- Not sure of the Fixes tag. --- drivers/pci/controller/dwc/pcie-kirin.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c index 2ee146767971..0b93de9d2d06 100644 --- a/drivers/pci/controller/dwc/pcie-kirin.c +++ b/drivers/pci/controller/dwc/pcie-kirin.c @@ -813,7 +813,15 @@ static int kirin_pcie_probe(struct platform_device *pdev) if (ret) return ret; - return dw_pcie_host_init(&pci->pp); + ret = dw_pcie_host_init(&pci->pp); + if (ret) + goto err_power_off; + + return 0; + +err_power_off: + kirin_pcie_power_off(kirin_pcie); + return ret; } static struct platform_driver kirin_pcie_driver = { -- 2.34.1