Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3642902pxb; Mon, 16 Nov 2020 22:43:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1lsd7kdfeGZFDwfbbkr9nwmbMZu8ROdIbFvzEzbQHh/rk3e+kZYZDNKqoExml4KEjdHC3 X-Received: by 2002:a17:907:b01:: with SMTP id h1mr17350750ejl.10.1605595405720; Mon, 16 Nov 2020 22:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605595405; cv=none; d=google.com; s=arc-20160816; b=QTgmRM+v9D4Hk2lzYoJRrmbjdDkHOWSQBzTQE9ayldFVV9PFhlN9/ADQmMZFwhEGMN /GBEz6ulQOoy9HfteG0Y6QFhB+BZl+WrNzLiw6K4arlMq6kdFVoFvG3KILNHpylD2Jpk h4B7G5pvAlTL37y6zNAgyJkCWFbkhYeakp8Oh9q3gvOf2xVQ0IGNeUJKyj59JuHLvphu no3Z4Rlnlp3KOG2/T9BteFVXZD3APXlFYt4nJjrUH5EFBhlAn6VO6Y0cMjXsV5ZvetiL wbGjMulqIIdu+GGol+ozdW2q3X+DEzqpmDykQKHVlKvae3N+eNadLzVS2rR6gRK26n8v Tx8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=+B67HO2EZIMwLEc/sEwtAtauhIZihR3x6iMqyPHWXoM=; b=sPXdLMFxxgWPEHUDHXak2BpJRgK22VEExThw6W2hmzvT1b/3/VvzpnmZvdd+irc94W UecYLftnIp2WcG2p2HOiSnNwU4LMMRAiM/I66BwpYECdfOoN06Xg6KKn7fokOipBaUbs Ma2DME6wBtjcPUiIkQTg4frl4Td9Gb73C4BLo1vkedMWj86asrpQUpu/AZmqn6THCwOH C64rGcmHDS8USNBv12mwtXdkjGUtZsPVDWEp1achqGpHGBAnLMTgSZpsyn776eVf7VvA /5467Y23TPS3bX8fwjqSEVGXEYAmb058coKy2DBe7SQZfMQiiyXgXfBmb9A1wII9Q+xr OPzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si8204293ejk.142.2020.11.16.22.43.03; Mon, 16 Nov 2020 22:43:25 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgKQGix (ORCPT + 99 others); Tue, 17 Nov 2020 01:38:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8102 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgKQGix (ORCPT ); Tue, 17 Nov 2020 01:38:53 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CZx92514GzLnW8; Tue, 17 Nov 2020 14:38:30 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 17 Nov 2020 14:38:46 +0800 From: Wang Hai To: , , , , , CC: , Subject: [PATCH v2] PCI: dwc: fix error return code in dw_pcie_host_init() Date: Tue, 17 Nov 2020 14:41:42 +0800 Message-ID: <20201117064142.32903-1-wanghai38@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.133] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 07940c369a6b ("PCI: dwc: Fix MSI page leakage in suspend/resume") Reported-by: Hulk Robot Signed-off-by: Wang Hai --- v1->v2: just add 'ret = xxx' drivers/pci/controller/dwc/pcie-designware-host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 44c2a6572199..42d8116a4a00 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -392,7 +392,8 @@ int dw_pcie_host_init(struct pcie_port *pp) sizeof(pp->msi_msg), DMA_FROM_DEVICE, DMA_ATTR_SKIP_CPU_SYNC); - if (dma_mapping_error(pci->dev, pp->msi_data)) { + ret = dma_mapping_error(pci->dev, pp->msi_data); + if (ret) { dev_err(pci->dev, "Failed to map MSI data\n"); pp->msi_data = 0; goto err_free_msi; -- 2.17.1