Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1078877pxb; Fri, 13 Nov 2020 03:46:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzl6jIO2MOYCsk0g0Md9ToSXaVb1NZeBXxZpilFBWVU2vTt58OoZILsendmQikzx2UIWXNX X-Received: by 2002:a50:bb06:: with SMTP id y6mr2110129ede.278.1605267983627; Fri, 13 Nov 2020 03:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605267983; cv=none; d=google.com; s=arc-20160816; b=NvmrEOju3x29Pks++mMjvN+4NJj4xBlPGNc8VWdSMjUoxqBv/NA0AUJxiJUefwldMA 3B++SRlc4bXRhXBXJSeNb6U/rSSdwSOU7D57gAun+LRt1mQ3qqAxFkagzX6mvZ97kcGd 1LXy9jJns+VOeyeUPoxGZfNG9VT9av7q/ufvDjSvruVXVKADFZLcN9aYRKCa8obdXsgR IlU9RXmBI7rlzvREekWUbIrOnDHNDpdnmWVbdYFrNDzFTp+kMcAkHWxV7tVY4MQB1aix hnDZQFZVW2tNQQ7kcIn32itix/o4uXcnQdE1BM6iGlexw3QSDPViNcburXkmPNQfCwzr kVNQ== 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=ENvJPD8956wQNLvkNsK2gqJAQUlOjlMHBvcwuCqD7u4=; b=nU9CmGikknyCFB2p5BGx185nHVcH1L7aREyckb2G6ES2RuHkItcUDW7OgFntOr1KnR i2HHgf1gZTpXFPAFGGYvaIst94LI509trq9bA5bgX6N55ozvtz2VXgmx2Z4lKUmYy0Zt itY/pNcwz4V+GzMcptPb0tPYe/7iXo7GXR9Z0QfLdnp6FNEycDTyH4ucHrt8cKPHHt5i Zj5GpBsygNrLUiT3SgTcCDz7qj8MJV/aqpo/BHp1cquoOnDhuBWmYpKpGrmfhvXkMjLa vfbis0pIdNU/F4aGfOY7EmXxYrXycKmX5QPstZTMT8UCejOqigSkIrIxXLHJ9ZA/SPc8 EyZA== 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 p3si6115349edp.84.2020.11.13.03.46.00; Fri, 13 Nov 2020 03:46:23 -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 S1726743AbgKMLcf (ORCPT + 99 others); Fri, 13 Nov 2020 06:32:35 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:7496 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbgKML3z (ORCPT ); Fri, 13 Nov 2020 06:29:55 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CXbpj6Ky2zhgGr; Fri, 13 Nov 2020 19:29:33 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 13 Nov 2020 19:29:35 +0800 From: Wang Hai To: , , , CC: , Subject: [PATCH net] net: marvell: prestera: fix error return code in prestera_pci_probe() Date: Fri, 13 Nov 2020 19:32:36 +0800 Message-ID: <20201113113236.71678-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: 4c2703dfd7fa ("net: marvell: prestera: Add PCI interface support") Reported-by: Hulk Robot Signed-off-by: Wang Hai --- drivers/net/ethernet/marvell/prestera/prestera_pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_pci.c b/drivers/net/ethernet/marvell/prestera/prestera_pci.c index 1b97adae542e..be5677623455 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_pci.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_pci.c @@ -676,7 +676,8 @@ static int prestera_pci_probe(struct pci_dev *pdev, if (err) return err; - if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30))) { + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30)); + if (err) { dev_err(&pdev->dev, "fail to set DMA mask\n"); goto err_dma_mask; } @@ -702,8 +703,10 @@ static int prestera_pci_probe(struct pci_dev *pdev, dev_info(fw->dev.dev, "Prestera FW is ready\n"); fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1); - if (!fw->wq) + if (!fw->wq) { + err = -ENOMEM; goto err_wq_alloc; + } INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn); -- 2.17.1