From patchwork Thu Oct 1 15:18:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 11811661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEEB16CB for ; Thu, 1 Oct 2020 15:20:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 704AB207F7 for ; Thu, 1 Oct 2020 15:20:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Zg41T2B8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="MrxToj3N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 704AB207F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:MIME-Version: Cc:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Message-Id:Date:Subject:To:From:Reply-To:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=BwCqq9dtYOFDEb/utwD8ia44hH5NUtfdh8LznMicTYQ=; b=Zg41T2B872lHvmGzgslz6wRqrr mYBEc1WIdOlkfmka+OCKOJUtSrxAjA3XpIsE5YO2d2sjrxhSscTHnogTNFntP8IkX+Q8Hv70k345u xYjxnVKwAe9TPavb4gqK9IKAQCvk1dKzaqOmyYXnlZiTciEitSEVdUzpubS2poO/+c6ictCM0y5QM czPy0PYYgLLMJ3Bmob7XhJgKgPHqOn9tF4qBw3hAf3sfRoa3OPoZu3fjQF6leT9Nqhq3xdxLn+cSx FJUfAWKVCRD5fpFcyM2w7JEXxj8h4HhPEuNJA8PseS7Jo8vXbeHJnxJRMhmLWJhvE7Kfzi4CJxFZU w3RHedRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO0Lr-0007QL-Jn; Thu, 01 Oct 2020 15:18:35 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO0Lm-0007OJ-Pw for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2020 15:18:32 +0000 Received: by mail-pj1-x1043.google.com with SMTP id l18so2156488pjz.1 for ; Thu, 01 Oct 2020 08:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=8f5MG5fmX5o6Uaf3YGXfSLEbvde1ZLOAf8xyAG4rjzY=; b=MrxToj3ND5GPXkSySjSo0P3QBuq921jcouc8V3/Xo5WguN3eqaMo8HA/hxiycdUEe7 wesN0ZVT9scizwyj8e99UeW/RhZW2RgXQHH2G9Y+oeMM8Ekca6wxjziPIAkip8UuQ3PM IJZuTGb+sKLcErzCYi6ybHkAjiSED3dPKYHSs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8f5MG5fmX5o6Uaf3YGXfSLEbvde1ZLOAf8xyAG4rjzY=; b=rWPSU79dd2uYw2OogfbCLZ4Pq5fMfN/W3i6s9QbjN9SoIlql63tpcLvkLsPSU9owdO 1wS37Ta+MAvLz1APe7KFbWFOJSrYMXl3d23QUJpgLZeqxPReahSHUCbxPB4DLrq8CW+1 t3yOAcTMTzTUlI0b13r8vuXyuJKExOGRHcobXsz0lQFs6RueJCdsFL3E7P9Cr9UKbjBQ d7V6uP4GpvbNiLcONpRwqOmfwYomxMiTrO/qzgY/zOq2p82yxpuerm5LofVC8kpgbYq3 QnQux2O/YFmAGj1Jh1GukwT84lPnmiyO8DU6D8VguEtySWn6lq6rhB14tnCvJJy5fSha 4pmw== X-Gm-Message-State: AOAM532koJ/EkInhhUlVqarHxZXM5TKUBAzzKt0BSusazDhanC4SRXKK NEuGRdM4eqMACxhWRKF2zFYJPA== X-Google-Smtp-Source: ABdhPJwTxDRaJxnOkim6qM7bk0kRNLhejNxL1G4XRcYuNfl80PLDGPRZWcTo1N3Y44FSkDiUcyHowg== X-Received: by 2002:a17:90a:9403:: with SMTP id r3mr493762pjo.52.1601565507574; Thu, 01 Oct 2020 08:18:27 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id f4sm6266737pfj.147.2020.10.01.08.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 08:18:26 -0700 (PDT) From: Jim Quinlan To: Dan Carpenter , Lorenzo Pieralisi , Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com Subject: [PATCH v1] PCI: brcmstb: fix error return paths in probe() Date: Thu, 1 Oct 2020 11:18:21 -0400 Message-Id: <20201001151821.27575-1-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_111830_884769_771FEE7D X-CRM114-Status: GOOD ( 12.35 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1043 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_TVD_MIME_NO_HEADERS BODY: No description available. -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers 1.3 MIME_NO_TEXT No (properly identified) text body parts -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Florian Fainelli , "open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS" , open list , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , Bjorn Helgaas , Jim Quinlan , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fixes two cases where we were returning without calling clk_disable_unprepare(). Although there is a common place to go on probe() errors (the 'fail' label), one can only jump there after executing brcm_pcie_setup(), so we have to add clk_disable_unprepare() calls to the two error paths. Fixes: b98f52bc6495 ("PCI: brcmstb: Add control of rescal reset") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Reviewed-by: Nicolas Saenz Julienne --- drivers/pci/controller/pcie-brcmstb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 6e7aa82a54a3..da2fefe80d47 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1269,8 +1269,10 @@ static int brcm_pcie_probe(struct platform_device *pdev) return ret; } pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); - if (IS_ERR(pcie->rescal)) + if (IS_ERR(pcie->rescal)) { + clk_disable_unprepare(pcie->clk); return PTR_ERR(pcie->rescal); + } ret = reset_control_deassert(pcie->rescal); if (ret) @@ -1279,6 +1281,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) ret = brcm_phy_start(pcie); if (ret) { reset_control_assert(pcie->rescal); + clk_disable_unprepare(pcie->clk); return ret; }