Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1113725pxx; Tue, 27 Oct 2020 08:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz83G4Bzcow3khr3byJnYtp6yllPQHNZoyyICK1D6nVhuKjwj0zG/t/ZmSn+Nosc2bkEoEN X-Received: by 2002:aa7:cad6:: with SMTP id l22mr2843613edt.229.1603812784915; Tue, 27 Oct 2020 08:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603812784; cv=none; d=google.com; s=arc-20160816; b=cSAL+bgf2uScKumPUnQG7EnT5xiXeRXN0qM/tOfa0OaGty0gGTGudy+1RQfz1mZc2p QS0NafoYtJ1s4XdQ+sd5jdvi17IBQA0MmbNyRi71fqdYjiXgoj7LEL7w0b+PL7mD1VCW Dx0RtRrS8J1o5Uac3zGp9hqqT6rCYdHLBN/vg1oX0iGjC79VWHHpzma6dhp+LdnFnh3D CQ+I2rMnhspW9LE9e+/M5jPPyKxTC2eein5W+30UDBLV6l+c+XyCLM2t2avfNsWw/LWZ lg+bzrvMw23i+TSdvtxaFmM1ce6EWUVF5f5qchQYgKOBbUonJvTMpn4BXGlH9vOn5oSx ugNg== 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=ENXkTvHbtoMn22096M3lRP78NbC8lt3tSHbr9GKTf0w=; b=fhDOJ9B8WtIK+Yx+ue2fdI3BEhztF31kB0gfltwJITVq6XaQ/8nhBIPNMXmXNuFNNh dQPzlptZrUWrBD1bbBL7rAMfLqQzNRn6omGEj99cf9+4Oy165wol7dvHUfGRu+sFRPLf NACZRA7nwMA4pAToeN2W2rRuCdMTMBEMMevlzlFLzaq7C5Z8YrEr+cz5ZCAZ5HnXOijo B0T12lG3bS+fRm+c1j+ZlXAfJCo0KTAxdpTkrGfH90elqXoeU9wKFmdGUB6OL7qlVCZk gfs6IyWGy+dIabaGxI+a2vsm4xwu4un09ZeP4Mskswy2+OPOpKl1nLWPNaH/gRakUnaI jV4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O3KGW1rX; 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 p9si1100814edy.462.2020.10.27.08.32.42; Tue, 27 Oct 2020 08:33:04 -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=O3KGW1rX; 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 S1762355AbgJ0Om3 (ORCPT + 99 others); Tue, 27 Oct 2020 10:42:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:39524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761931AbgJ0OkY (ORCPT ); Tue, 27 Oct 2020 10:40:24 -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 2F753207BB; Tue, 27 Oct 2020 14:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809622; bh=Pkodcc0QYTb16u6wZo6rczQdApgVsy1vL1dCe8RTyis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3KGW1rXzKIOOvNjqG1T6++qLNzGck+dp8B/hJAtp3xoVu6iEe9HKajbSZoTtzNOv NVYaBryiBgwss+0+EEzed5mkKfWTE4/0gIJRfVxY+V7R+GRrawELl+InrgV3UbCyZx EgQm3ZfUuhKwQI31krrVamlzowc0Ftb67ZG3Krq0= 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.4 262/408] PCI: aardvark: Check for errors from pci_bridge_emul_init() call Date: Tue, 27 Oct 2020 14:53:20 +0100 Message-Id: <20201027135507.201240352@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 f2481e80e2723..d0e60441dc8f2 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -503,7 +503,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; @@ -527,8 +527,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, @@ -1027,7 +1026,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