[v2] net/softnic: fix memory leak for thread

Message ID 20200427171320.82107-1-jasvinder.singh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] net/softnic: fix memory leak for thread |

Checks

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

Commit Message

Jasvinder Singh April 27, 2020, 5:13 p.m. UTC
  For sending request messages to data plane threads, the
caller invokes thread_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity Issue: 357717, 357772
Fixes: 70709c78fda6 ("net/softnic: add command to enable/disable pipeline")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
v2:
- change commit message

 drivers/net/softnic/rte_eth_softnic_thread.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Ferruh Yigit May 1, 2020, 3:47 p.m. UTC | #1
On 4/27/2020 6:13 PM, Jasvinder Singh wrote:
> For sending request messages to data plane threads, the
> caller invokes thread_msg_send_recv() function which never
> returns null response. Thus, removed redundant check on
> the returned response.
> 
> Coverity Issue: 357717, 357772
> Fixes: 70709c78fda6 ("net/softnic: add command to enable/disable pipeline")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index d610b1617..d61846e03 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -359,8 +359,6 @@  softnic_thread_pipeline_enable(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = thread_msg_send_recv(softnic, thread_id, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -444,8 +442,6 @@  softnic_thread_pipeline_disable(struct pmd_internals *softnic,
 
 	/* Send request and wait for response */
 	rsp = thread_msg_send_recv(softnic, thread_id, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;