From: Harry van Haaren Date: Mon, 17 Jul 2017 16:09:47 +0000 (+0100) Subject: eventdev: fix memory realloc check in port config X-Git-Tag: spdx-start~2417 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f9a96a50d8abc03f704d02defc8cb6238ff20a58;p=dpdk.git eventdev: fix memory realloc check in port config 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") Signed-off-by: Harry van Haaren Reviewed-by: Jerin Jacob --- diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index ca2900c983..bbb380502d 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);