DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] lib/lpm: fix return value of rte_lpm_create
@ 2018-01-31 12:40 Anatoly Burakov
  2018-01-31 13:11 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-01-31 12:40 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, zhiyong.yang

LPM library is supposed to return NULL pointer on an attempt
to call rte_lpm_create with an existing name.

Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")
Cc: zhiyong.yang@intel.com

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_lpm/rte_lpm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index d464dbd..efbbbca 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -254,6 +254,7 @@ rte_lpm_create_v1604(const char *name, int socket_id,
 		if (strncmp(name, lpm->name, RTE_LPM_NAMESIZE) == 0)
 			break;
 	}
+	lpm = NULL;
 
 	if (te != NULL) {
 		rte_errno = EEXIST;
-- 
2.7.4

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

end of thread, other threads:[~2018-01-31 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 12:40 [dpdk-dev] [PATCH] lib/lpm: fix return value of rte_lpm_create Anatoly Burakov
2018-01-31 13:11 ` Bruce Richardson
2018-01-31 13:29   ` Burakov, Anatoly

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).