Received: by 10.213.65.68 with SMTP id h4csp303341imn; Fri, 23 Mar 2018 05:08:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELtYtp1GpKEIkTXymXGnRurFGUuZ0LCYMSbxRHA2LaWDQ9/9+Wv3zacO2H/1BJFQEiX8MAzl X-Received: by 2002:a17:902:bf03:: with SMTP id bi3-v6mr29065405plb.343.1521806887188; Fri, 23 Mar 2018 05:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521806887; cv=none; d=google.com; s=arc-20160816; b=J2mb3YeeCD4cO+jK+9kvwTNG97kHyEB6gyApAm+yVX/bwsqHpJP5G0M/venkvVZdzc sakXMEdtKpaVkDYcLwxrcUXeNDdG2K3XeqPaHSf3uE6Zk9WGbEdRS5JKiA6ZdEqPzkyP +hrn/mjbB6zqIostgwhwN+k9ytC+WUAnyK5T4lnzsDECR80m0bHmnJlNWtSpgwwFn2Hp lZJkzs+fTCbV8WVn4/ExcL8nSQOflmYT/lWSePxtAtQ9GmdxR43cYK3Ppts1Wda0gKsX l5QcOMGnTmZ2hDP5JiNYpCYfqwgjvTnLfsOpSkePrDIxw1Ac/hRtrLxMx/JfM0izcqyE QcLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=C1WkGMcSFwfwfvG+x2jFpykGcFw0eO9ClizfoaKEUMQ=; b=k/ZDkJ8hMrGeUIkbhy9gdvsUZv1g07nrmzRLz/dJBN+Yu/mMs3Rgt5vH0FXziMWxPR qjzoM0mDy8mlmo7m7wx/09ndtoeQ4gwdc4OYzXfSL38Stlhvdf+DclZJRpHlgVQLaHJ6 rX9oT78QRgF8bI4Vpxji95jQ+YdbSdwytPzLsHhihifPAIlo+dNT9HyjzI8QqXJ6Cphs KvLcTPXSLLFHbXBN6+nNM5xnXhBLpYAlbaurioiqsX2VeQrcDQcQBR0uMBmsKo6C90fB RglaJRPW9wDk0x59Hpu1ks2uUjp2/wdP5fp6WzbagqRtE97baJJ0UdqxUNHR6HtyDYAP 8IBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si5625568pgq.491.2018.03.23.05.07.52; Fri, 23 Mar 2018 05:08:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbeCWMHF (ORCPT + 99 others); Fri, 23 Mar 2018 08:07:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35882 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbeCWJ6u (ORCPT ); Fri, 23 Mar 2018 05:58:50 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 73ACA1343; Fri, 23 Mar 2018 09:58:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH 4.15 53/84] PCI: rcar: Handle rcar_pcie_parse_request_of_pci_ranges() failures Date: Fri, 23 Mar 2018 10:54:07 +0100 Message-Id: <20180323095419.997389319@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323095411.913234798@linuxfoundation.org> References: <20180323095411.913234798@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geert Uytterhoeven [ Upstream commit 83c75ddd816e979802bd244ad494139f28152921 ] rcar_pcie_parse_request_of_pci_ranges() can fail and return an error code, but this is not checked nor handled. Fix this by adding the missing error handling. Fixes: 5d2917d469faab72 ("PCI: rcar: Convert to DT resource parsing API") Signed-off-by: Geert Uytterhoeven Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/pci/host/pcie-rcar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -1123,7 +1123,9 @@ static int rcar_pcie_probe(struct platfo INIT_LIST_HEAD(&pcie->resources); - rcar_pcie_parse_request_of_pci_ranges(pcie); + err = rcar_pcie_parse_request_of_pci_ranges(pcie); + if (err) + goto err_free_bridge; err = rcar_pcie_get_resources(pcie); if (err < 0) { @@ -1178,6 +1180,7 @@ err_pm_disable: err_free_resource_list: pci_free_resource_list(&pcie->resources); +err_free_bridge: pci_free_host_bridge(bridge); return err;