ring: fix minor memory leak of kvlist in dev init
PATCH 1/1 ring: fix minor memory leak of kvlist in dev init
Fix for Klockwork identified issue.
--- lib/librte_pmd_ring/rte_eth_ring.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
lib/librte_pmd_ring/rte_eth_ring.c +2 -1
@@ -527,7 +527,7 @@ out:static int rte_pmd_ring_devinit (const char *name,const char *params) { -struct rte_kvargs *kvlist; +struct rte_kvargs *kvlist =NULL ;int ret =0 ;struct node_action_list *info =NULL ;
@@ -569,6 +569,7 @@ rte_pmd_ring_devinit(const char *name, const char *params) out_free:rte_free (info); out: +rte_kvargs_free (kvlist);return ret; }
Signature · 1 line
1.7.4.1
A message that is not in the archive (sent off-list or not yet received): 1424697435-13667-1-git-send-email-john.mcnamara-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Quoted 39 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of John McNamara
Sent: Monday, February 23, 2015 2:17 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] ring: fix minor memory leak of kvlist in dev initFix for Klockwork identified issue.
Signed-off-by John McNamara <[email protected]>--- lib/librte_pmd_ring/rte_eth_ring.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)lib/librte_pmd_ring/rte_eth_ring.c +2
-2@@ -527,7 +527,7 @@ out:static int rte_pmd_ring_devinit (const char *name,const char *params) { -struct rte_kvargs *kvlist; +struct rte_kvargs *kvlist =NULL ;int ret =0 ;struct node_action_list *info =NULL ;@@ -569,6 +569,7 @@ rte_pmd_ring_devinit(const char *name, const char *params) out_free:rte_free (info); out: +rte_kvargs_free (kvlist);return ret; } --
Quoted 1 line
1.7.4.1
This is wrong/incomplete as rte_kvargs_free() is unable to handle NULL argument. I have patch under review that fix this issue along with rte_kvargs_free().
Pawel
Quoted 8 lines
-----Original Message-----
From: Mcnamara, John
Sent: Monday, February 23, 2015 1:17 PM
To: [email protected]
Cc: Mcnamara, John
Subject: [PATCH] ring: fix minor memory leak of kvlist in dev initFix for Klocwork identified issue.
Superseded by:
http://dpdk.org/ml/archives/dev/2015-February/013937.html
John