[ovs-dev,v2,3/4] netdev-dpdk: assert mempool names.

Message ID 1506608894-22573-3-git-send-email-antonio.fischetti@intel.com
State Superseded
Headers show
Series
  • [ovs-dev,v2,1/4] netdev-dpdk: fix mempool management with vhu client.
Related show

Commit Message

Fischetti, Antonio Sept. 28, 2017, 2:28 p.m.
From: Antonio Fischetti <antonio.fischetti@intel.com>

CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Kevin Traynor <ktraynor@redhat.com>
CC: Aaron Conole <aconole@redhat.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
---
 lib/netdev-dpdk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 25fb9a8..dded37f 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -501,9 +501,7 @@  dpdk_mp_name(struct dpdk_mp *dmp)
     char *mp_name = xcalloc(RTE_MEMPOOL_NAMESIZE, sizeof *mp_name);
     int ret = snprintf(mp_name, RTE_MEMPOOL_NAMESIZE, "ovs_%x_%d_%u",
                        h, dmp->mtu, dmp->mp_size);
-    if (ret < 0 || ret >= RTE_MEMPOOL_NAMESIZE) {
-        return NULL;
-    }
+    ovs_assert(ret >= 0 && ret < RTE_MEMPOOL_NAMESIZE);
     return mp_name;
 }