diff mbox series

port: fix dead code in ring

Message ID 20210407105945.18064-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series port: fix dead code in ring | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/checkpatch success coding style OK

Commit Message

Dumitrescu, Cristian April 7, 2021, 10:59 a.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Monjalon April 19, 2021, 5:41 p.m. UTC | #1
07/04/2021 12:59, Cristian Dumitrescu:
> 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>

It's not really fixing dead code but allocation check.
With title fixed, applied, thanks.
diff mbox series

Patch

diff --git a/lib/librte_port/rte_swx_port_ring.c b/lib/librte_port/rte_swx_port_ring.c
index 4df720d91..8a076a213 100644
--- a/lib/librte_port/rte_swx_port_ring.c
+++ b/lib/librte_port/rte_swx_port_ring.c
@@ -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 *));