From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5C8C2376C for ; Mon, 17 Jul 2017 18:09:56 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 17 Jul 2017 09:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,375,1496127600"; d="scan'208";a="127693869" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by fmsmga005.fm.intel.com with ESMTP; 17 Jul 2017 09:09:47 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: Harry van Haaren , jerin.jacob@caviumnetworks.com Date: Mon, 17 Jul 2017 17:09:47 +0100 Message-Id: <1500307787-73213-1-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] event: fix memory realloc check in port config 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: , X-List-Received-Date: Mon, 17 Jul 2017 16:09:56 -0000 This commit fixes the check to use the just reallocated links_map variable, instead of stale dev->data->links_map. Later the new variable is written to the dev->data->links_map, so the stale-ness is only temporary. Coverity issue: 143456 Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs") Cc: jerin.jacob@caviumnetworks.com Signed-off-by: Harry van Haaren --- lib/librte_eventdev/rte_eventdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index ca2900c..bbb3805 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -298,7 +298,7 @@ rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) sizeof(dev->data->links_map[0]) * nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV, RTE_CACHE_LINE_SIZE); - if (dev->data->links_map == NULL) { + if (links_map == NULL) { dev->data->nb_ports = 0; RTE_EDEV_LOG_ERR("failed to realloc mem for port_map," "nb_ports %u", nb_ports); -- 2.7.4