DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] event: fix memory realloc check in port config
@ 2017-07-17 16:09 Harry van Haaren
  2017-07-19  3:46 ` Jerin Jacob
  2017-07-19  3:51 ` Jerin Jacob
  0 siblings, 2 replies; 3+ messages in thread
From: Harry van Haaren @ 2017-07-17 16:09 UTC (permalink / raw)
  To: dev; +Cc: Harry van Haaren, jerin.jacob

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 <harry.van.haaren@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event: fix memory realloc check in port config
  2017-07-17 16:09 [dpdk-dev] [PATCH] event: fix memory realloc check in port config Harry van Haaren
@ 2017-07-19  3:46 ` Jerin Jacob
  2017-07-19  3:51 ` Jerin Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2017-07-19  3:46 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev

-----Original Message-----
> Date: Mon, 17 Jul 2017 17:09:47 +0100
> From: Harry van Haaren <harry.van.haaren@intel.com>
> To: dev@dpdk.org
> CC: Harry van Haaren <harry.van.haaren@intel.com>,
>  jerin.jacob@caviumnetworks.com
> Subject: [PATCH] event: fix memory realloc check in port config
> X-Mailer: git-send-email 2.7.4
> 
> 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

Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

> 
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>  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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] event: fix memory realloc check in port config
  2017-07-17 16:09 [dpdk-dev] [PATCH] event: fix memory realloc check in port config Harry van Haaren
  2017-07-19  3:46 ` Jerin Jacob
@ 2017-07-19  3:51 ` Jerin Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2017-07-19  3:51 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev

-----Original Message-----
> Date: Mon, 17 Jul 2017 17:09:47 +0100
> From: Harry van Haaren <harry.van.haaren@intel.com>
> To: dev@dpdk.org
> CC: Harry van Haaren <harry.van.haaren@intel.com>,
>  jerin.jacob@caviumnetworks.com
> Subject: [PATCH] event: fix memory realloc check in port config
> X-Mailer: git-send-email 2.7.4

Need to change the subject to start with "eventdev:" instead of "event:".
We could fix it on apply.

> 
> 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 <harry.van.haaren@intel.com>
> ---

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-19  3:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 16:09 [dpdk-dev] [PATCH] event: fix memory realloc check in port config Harry van Haaren
2017-07-19  3:46 ` Jerin Jacob
2017-07-19  3:51 ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).