Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp281913pxx; Wed, 28 Oct 2020 04:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCa/iuetxaz1WfDYkBnKZa4AzIIPKxQsAUmr8eLUkyq4nPo7H0PMKsJuv+vaJsNsab2pcw X-Received: by 2002:a50:e887:: with SMTP id f7mr7153038edn.276.1603886260632; Wed, 28 Oct 2020 04:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886260; cv=none; d=google.com; s=arc-20160816; b=woZR8Sbhs95OTrP9rEikQAJkBnjDquBieNirszJlZWG6GzYLDDHw9sB2mEIY91ueZn S/2TkNcJZzgKphi+7KTcnLiRyezYsGEvwYPcX567BlssGfqnuYHEZcFKlnJvt1Z9x/1D stjsgz7upSLsdayF5oNd71NRLO8WRAC4mNbncYrAmE652wGnVZJX0ge2u1mr/jQdjbWp Q/QH7uYUUeP7ObqmYCJGbk24k8OeIscKUNLi6WxYaOBtVmVveFItsG2ffl00JfL5Fryn HAb5dYopFIzJIu51+KIvHPwixB/MHwnqcmQhJkaR4eu72F27KFhBwYWereYxv8u4wIRG e3Og== 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=6J4F/l/eAcWC37b6pPGQUR2rGlRs4D4CoFbj6UvjjNs=; b=uXSfgFnM1mNS5AUJxVfE3GKNjTdmifzQ7j1g7Holf2gdEcGdQ29M8Izqc/tg1OvnC9 4RPYzqjbtfZqKarpO2hCTB0RmM/4lvsZMYuJHOtFCOMjtj+9hkVE2IPN+YVq02/NJrZ3 UFoUTp0iwm7NOu9LEtkynTdQ7gLx+9iZW4g0NQzKFlUgFZCuyxp7e5Z+JoqckW6kJLWk pA+QE+HKkv5SkFLcpx/SBhzgnpn4KnHrYwv4bsOnrqAriBZxVGOq/IoZ0t5kBXXSYnbp 6TQr7koZE8hvSUDgUNXCOg0jQuwIUW09W51o3uMvieBsW944iKnnm0GNR/f1ZmWfnwpv c2nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBDza88D; 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 w17si2969573ejk.629.2020.10.28.04.57.17; Wed, 28 Oct 2020 04:57:40 -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=KBDza88D; 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 S1794838AbgJ0PNw (ORCPT + 99 others); Tue, 27 Oct 2020 11:13:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:42040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793664AbgJ0PHn (ORCPT ); Tue, 27 Oct 2020 11:07:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 A123C20720; Tue, 27 Oct 2020 15:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811263; bh=zTrIGX5j6lGm9KtvsQcpAoF40FD1TkjkOgesb4rR1FI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBDza88DIjujJahjSJ8e5B5xoZ2eWhbob1vTCKsXlh+/Knxdl5y7wsSrxXNb6cDcw JZBwD2m5NdaYE4w5K1YVjGRi1BdEvf5ZZ+wQBvGXL7Aa9PPa0U97KzvCiSg06RrkRx u9iUjpDepNSenxP18gw8N681mBQL5oh68iaovCHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Sasha Levin Subject: [PATCH 5.8 431/633] PCI: aardvark: Check for errors from pci_bridge_emul_init() call Date: Tue, 27 Oct 2020 14:52:54 +0100 Message-Id: <20201027135542.939260118@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Pali Rohár [ Upstream commit 7862a6134456c8b4f8c39e8c94aa97e5c2f7f2b7 ] Function pci_bridge_emul_init() may fail so correctly check for errors. Link: https://lore.kernel.org/r/20200907111038.5811-3-pali@kernel.org Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Behún Signed-off-by: Sasha Levin --- drivers/pci/controller/pci-aardvark.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 8caa80b19cf86..d5f58684d962c 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -608,7 +608,7 @@ static struct pci_bridge_emul_ops advk_pci_bridge_emul_ops = { * Initialize the configuration space of the PCI-to-PCI bridge * associated with the given PCIe interface. */ -static void advk_sw_pci_bridge_init(struct advk_pcie *pcie) +static int advk_sw_pci_bridge_init(struct advk_pcie *pcie) { struct pci_bridge_emul *bridge = &pcie->bridge; @@ -634,8 +634,7 @@ static void advk_sw_pci_bridge_init(struct advk_pcie *pcie) bridge->data = pcie; bridge->ops = &advk_pci_bridge_emul_ops; - pci_bridge_emul_init(bridge, 0); - + return pci_bridge_emul_init(bridge, 0); } static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bus *bus, @@ -1169,7 +1168,11 @@ static int advk_pcie_probe(struct platform_device *pdev) advk_pcie_setup_hw(pcie); - advk_sw_pci_bridge_init(pcie); + ret = advk_sw_pci_bridge_init(pcie); + if (ret) { + dev_err(dev, "Failed to register emulated root PCI bridge\n"); + return ret; + } ret = advk_pcie_init_irq_domain(pcie); if (ret) { -- 2.25.1