examples/ip_pipeline: fix resource leak for thread

Message ID 20200427165649.50591-1-jasvinder.singh@intel.com (mailing list archive)
State Accepted, archived
Headers
Series examples/ip_pipeline: fix resource leak for thread |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
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

Commit Message

Jasvinder Singh April 27, 2020, 4:56 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 Issues: 357773, 357723
Fixes: 32e5d9b154cb ("examples/ip_pipeline: add enable and disable commands")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/ip_pipeline/thread.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Thomas Monjalon May 24, 2020, 4:19 p.m. UTC | #1
27/04/2020 18:56, Jasvinder Singh:
> 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 Issues: 357773, 357723
> Fixes: 32e5d9b154cb ("examples/ip_pipeline: add enable and disable commands")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

This patch has been forgotten.

Applied and squashed with "fix resource leak for pipeline".
  

Patch

diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index 272fbbeed..fda4d3c2a 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -325,8 +325,6 @@  thread_pipeline_enable(uint32_t thread_id,
 
 	/* Send request and wait for response */
 	rsp = thread_msg_send_recv(thread_id, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -412,8 +410,6 @@  thread_pipeline_disable(uint32_t thread_id,
 
 	/* Send request and wait for response */
 	rsp = thread_msg_send_recv(thread_id, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;