port: fix allocation check in ring SWX
authorCristian Dumitrescu <cristian.dumitrescu@intel.com>
Wed, 7 Apr 2021 10:59:45 +0000 (11:59 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 19 Apr 2021 17:33:46 +0000 (19:33 +0200)
Fix logically dead code in ring port.

Coverity issue: 369664
Fixes: 77a413017c2d ("port: add ring SWX port")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/librte_port/rte_swx_port_ring.c

index 4df720d..8a076a2 100644 (file)
@@ -195,7 +195,7 @@ writer_create(void *args)
                goto error;
 
        p->params.name = strdup(params->name);
-       if (!p)
+       if (!p->params.name)
                goto error;
 
        p->pkts = calloc(params->burst_size, sizeof(struct rte_mbuf *));