From patchwork Fri Nov 16 14:54:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daly, Lee" X-Patchwork-Id: 48160 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0514E2BD8; Fri, 16 Nov 2018 15:54:37 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 1B06D2B94 for ; Fri, 16 Nov 2018 15:54:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Nov 2018 06:54:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,240,1539673200"; d="scan'208";a="105160917" Received: from silpixa00399501.ir.intel.com ([10.237.223.69]) by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2018 06:54:33 -0800 From: Lee Daly To: declan.doherty@intel.com, chas3@att.com Cc: dev@dpdk.org, Lee Daly Date: Fri, 16 Nov 2018 14:54:27 +0000 Message-Id: <1542380067-140320-1-git-send-email-lee.daly@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/bonding: check return value in bond_ethdev_configure 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" This patch checks the return value of function rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure for error return value. Signed-off-by: Lee Daly --- drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 156f31c..a7612ae 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3420,9 +3420,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev) "Failed to parse agg selection mode for bonded device %s", name); } - if (internals->mode == BONDING_MODE_8023AD) - rte_eth_bond_8023ad_agg_selection_set(port_id, - agg_mode); + if (internals->mode == BONDING_MODE_8023AD) { + if (rte_eth_bond_8023ad_agg_selection_set(port_id, + agg_mode) < 0) { + RTE_BOND_LOG(ERR, "Invalid args for agg selection" + " set for bonded device %s", name); + return -1; + } + } } /* Parse/add slave ports to bonded device */