DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>, zhiyong.yang@intel.com
Subject: [dpdk-dev] [PATCH] lib/lpm: fix return value of rte_lpm_create
Date: Wed, 31 Jan 2018 12:40:59 +0000	[thread overview]
Message-ID: <4bc7c2df8284aa94d37cbb8f80b7f952dd03d6f8.1517401724.git.anatoly.burakov@intel.com> (raw)

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

             reply	other threads:[~2018-01-31 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 12:40 Anatoly Burakov [this message]
2018-01-31 13:11 ` Bruce Richardson
2018-01-31 13:29   ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4bc7c2df8284aa94d37cbb8f80b7f952dd03d6f8.1517401724.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=zhiyong.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).