Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3097642pxb; Mon, 16 Nov 2020 05:52:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxen9xRKDUPxCJg7c26igpQEmURYPUG2bbnI5rycNMc6kQ9BJecRRPXakYZPnNvQtFNbS8Z X-Received: by 2002:a50:bc04:: with SMTP id j4mr15278506edh.316.1605534732727; Mon, 16 Nov 2020 05:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605534732; cv=none; d=google.com; s=arc-20160816; b=yu7Wi+cO3iausAKz6iZ3VLVDy0NfPbdbpBqHJkVjMv7fUR0zJc8F3m+0ZWURC2qXuc IiJ0XT1V6GITW80kdmE+ZEoyI9nyUWCPHwroRPAjPKuZOKrdrUNNMPwV4HPoCUHl2gOr kQizzxzmd57qxIX++c8mBWbycYmqdtNQONl38Y5lzK3JOhEZMcZq5c4vs0cDjXs2oPIU 7OQEDOWAytWs24bpmjlr3ifuXAJwe3Sk4wuEEioBSvUZY2z0mf666r2QdgasFqOWERlB Xo4aMRBh44WHMLAC8y6ch1iFFG0KlUZunyvhTBOD7rHy1sHhcQYstv6otEOT15cLzZmm 4NZA== 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=axhdffkrHrcOGSxJ/+ByDUk1WoVPX8PlUda4yaofjxk=; b=OftlVKI4lMQcTVdQlILWETsfm7OA439gLEevGG0PrLlkR3L7OevM2MMUVJGiVeyEHh scIO6aepEWfmQqPIwyvQEUuAZ0IqPuM8j6t+yUv5Jyr7ZYjqNYpkn6tpoKJHY9ONr3sM Z5dYpII7x9fLtiQJE95Tdi/xS5mz9w3iClSqsIDIHqIa1ya8e95eKLiLA7X31PmMMkTj 2QfFe0F+gpAMXghvHggv3RztsJgd/zJz9v/Q+/q8ww5amMn0y38SNnLQFB604cTXOrk/ i3eZ8WB+FlNexmgjoEGr7vXSjID2xnCWdaZ1quPHcowHxTcQopNUL++AThQBZHZXj7AX 2Vyg== 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 j12si12570084edy.584.2020.11.16.05.51.49; Mon, 16 Nov 2020 05:52:12 -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 S1729232AbgKPNrf (ORCPT + 99 others); Mon, 16 Nov 2020 08:47:35 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8093 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbgKPNre (ORCPT ); Mon, 16 Nov 2020 08:47:34 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CZVk81SnkzLncW; Mon, 16 Nov 2020 21:47:12 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Mon, 16 Nov 2020 21:47:26 +0800 From: Wang Hai To: , , , , , CC: , Subject: [PATCH] PCI: dwc: fix error return code in dw_pcie_host_init() Date: Mon, 16 Nov 2020 21:50:23 +0800 Message-ID: <20201116135023.57321-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 --- drivers/pci/controller/dwc/pcie-designware-host.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 44c2a6572199..7b3c91c6ae02 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -395,6 +395,7 @@ int dw_pcie_host_init(struct pcie_port *pp) if (dma_mapping_error(pci->dev, pp->msi_data)) { dev_err(pci->dev, "Failed to map MSI data\n"); pp->msi_data = 0; + ret = -ENOMEM; goto err_free_msi; } } else { -- 2.17.1