From patchwork Tue Jul 14 08:19:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wei Hu (Xavier)" X-Patchwork-Id: 73995 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3FEC2A0540; Tue, 14 Jul 2020 10:21:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 327541D570; Tue, 14 Jul 2020 10:21:40 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id EAD0F1D56F for ; Tue, 14 Jul 2020 10:21:37 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1BE117E241F6A4483602; Tue, 14 Jul 2020 16:21:36 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Tue, 14 Jul 2020 16:21:28 +0800 From: "Wei Hu (Xavier)" To: , , , CC: Date: Tue, 14 Jul 2020 16:19:43 +0800 Message-ID: <1594714783-23996-1-git-send-email-xavier.huwei@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/bonding: fix error code when creating bonded device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Because the return value of rte_vdev_init() has multiple non-zero values, when rte_vdev_init() return non-zero in the rte_eth_bond_create() function, it should return the actual error code rather than -ENOMEM. Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free") Cc: stable@dpdk.org Signed-off-by: Wei Hu (Xavier) --- drivers/net/bonding/rte_eth_bond_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index f38eb3b..d77dc40 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -167,7 +167,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) ret = rte_vdev_init(name, devargs); if (ret) - return -ENOMEM; + return ret; ret = rte_eth_dev_get_port_by_name(name, &port_id); RTE_ASSERT(!ret);