From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 51A592E8A for ; Thu, 26 Feb 2015 15:00:40 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 26 Feb 2015 05:56:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,652,1418112000"; d="scan'208";a="672051907" Received: from unknown (HELO rkwiles-desk.ger.corp.intel.com) ([10.255.41.74]) by fmsmga001.fm.intel.com with ESMTP; 26 Feb 2015 06:00:36 -0800 From: Keith Wiles To: dev@dpdk.org Date: Thu, 26 Feb 2015 08:00:32 -0600 Message-Id: <1424959232-60341-1-git-send-email-keith.wiles@intel.com> X-Mailer: git-send-email 2.3.0 Subject: [dpdk-dev] [PATCH] Missing use of macro rte_eth_dev_is_valid_port() 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, 26 Feb 2015 14:00:40 -0000 Signed-off-by: Keith Wiles --- lib/librte_ether/rte_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index bb94ccb..6fd89d7 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3541,7 +3541,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, return NULL; #endif /* check input parameters */ - if (port_id >= nb_ports || fn == NULL || + if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL || queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) { rte_errno = EINVAL; return NULL; @@ -3570,7 +3570,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, return NULL; #endif /* check input parameters */ - if (port_id >= nb_ports || fn == NULL || + if (!rte_eth_dev_is_valid_port(port_id) || fn == NULL || queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) { rte_errno = EINVAL; return NULL; @@ -3598,7 +3598,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, return (-ENOTSUP); #endif /* Check input parameters. */ - if (port_id >= nb_ports || user_cb == NULL || + if (!rte_eth_dev_is_valid_port(port_id) || user_cb == NULL || queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) { return (-EINVAL); } @@ -3637,7 +3637,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, return (-ENOTSUP); #endif /* Check input parameters. */ - if (port_id >= nb_ports || user_cb == NULL || + if (!rte_eth_dev_is_valid_port(port_id) || user_cb == NULL || queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) { return (-EINVAL); } -- 2.3.0