From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (unknown [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C1E8195BA for ; Thu, 22 Oct 2015 14:55:28 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yaacovh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 22 Oct 2015 14:55:18 +0200 Received: from r-aa-dragon14.mtr.labs.mlnx (r-aa-dragon14.mtr.labs.mlnx [10.209.68.154]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t9MCtIXT021864; Thu, 22 Oct 2015 15:55:18 +0300 Received: from r-aa-dragon14.mtr.labs.mlnx (localhost [127.0.0.1]) by r-aa-dragon14.mtr.labs.mlnx (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id t9MCtOPj015671; Thu, 22 Oct 2015 15:55:24 +0300 Received: (from yaacovh@localhost) by r-aa-dragon14.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id t9MCtJTd015668; Thu, 22 Oct 2015 15:55:19 +0300 From: Yaacov Hazan To: dev@dpdk.org Date: Thu, 22 Oct 2015 15:55:16 +0300 Message-Id: <1445518516-15630-1-git-send-email-yaacovh@mellanox.com> X-Mailer: git-send-email 1.9.1 Cc: Raslsn Darawsheh Subject: [dpdk-dev] [PATCH] net:bonding: fix free_queues function when no queues exist X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 12:55:29 -0000 From: Raslsn Darawsheh In case of creating bond device without add any slaves and quit from testpmd, application crashed since rx/tx queues are NULL. add checking of this paramters before trying to free. Signed-off-by: Raslsn Darawsheh Signed-off-by: Yaacov Hazan --- drivers/net/bonding/rte_eth_bond_pmd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 5cc6372..40b63d7 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1518,12 +1518,18 @@ bond_ethdev_free_queues(struct rte_eth_dev *dev) uint8_t i; for (i = 0; i < dev->data->nb_rx_queues; i++) { + if (dev->data->rx_queues[i] == NULL) + continue; + rte_free(dev->data->rx_queues[i]); dev->data->rx_queues[i] = NULL; } dev->data->nb_rx_queues = 0; for (i = 0; i < dev->data->nb_tx_queues; i++) { + if (dev->data->tx_queues[i] == NULL) + continue; + rte_free(dev->data->tx_queues[i]); dev->data->tx_queues[i] = NULL; } -- 1.9.1