DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/ip_pipeline: fix resource leak for pipeline
@ 2020-04-27 16:57 Jasvinder Singh
  2020-05-24 16:18 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Jasvinder Singh @ 2020-04-27 16:57 UTC (permalink / raw)
  To: dev; +Cc: cristian.dumitrescu

For sending request messages to data plane threads, the
caller invokes pipeline_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity Issues: 357750, 357740, 357749, 357758, 357702, 357736,
357679, 357791, 357738, 357778, 357716, 357705, 357776, 357753,
357729, 357735

Fixes: 50e73d051806 ("examples/ip_pipeline: add stats read commands")
Fixes: 6b1b3c3c9d30 ("examples/ip_pipeline: add port enable and disable commands")
Fixes: a3a95b7d58b9 ("examples/ip_pipeline: add table entry commands")
Fixes: 3186282f8e12 ("examples/ip_pipeline: add table bulk add command")
Fixes: f634e4c5698a ("examples/ip_pipeline: add table entry delete command")
Fixes: c64b9121a963 ("examples/ip_pipeline: add table entry stats command")
Fixes: 7e11393e40ef ("examples/ip_pipeline: add meter profile commands")
Fixes: e92058d604e6 ("examples/ip_pipeline: add meter stats command")
Fixes: 2b82ef4861c0 ("examples/ip_pipeline: add DSCP table update command")
Fixes: d0d306c7f2a1 ("examples/ip_pipeline: add TTL stats command")
Fixes: a3169ee5ec59 ("examples/ip_pipeline: support rule time read")

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

diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index fda4d3c2a..adb83167c 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -811,8 +811,6 @@ pipeline_port_in_stats_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -859,8 +857,6 @@ pipeline_port_in_enable(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -905,8 +901,6 @@ pipeline_port_in_disable(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -959,8 +953,6 @@ pipeline_port_out_stats_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1015,8 +1007,6 @@ pipeline_table_stats_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1432,10 +1422,6 @@ pipeline_table_rule_add(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL) {
-		free(rule);
-		return -1;
-	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1534,10 +1520,6 @@ pipeline_table_rule_add_default(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL) {
-		free(rule);
-		return -1;
-	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1651,10 +1633,6 @@ pipeline_table_rule_add_bulk(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL) {
-		table_rule_list_free(list);
-		return -ENOMEM;
-	}
 
 	/* Read response */
 	status = rsp->status;
@@ -1729,8 +1707,6 @@ pipeline_table_rule_delete(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1786,8 +1762,6 @@ pipeline_table_rule_delete_default(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1853,8 +1827,6 @@ pipeline_table_rule_stats_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1911,8 +1883,6 @@ pipeline_table_mtr_profile_add(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -1963,8 +1933,6 @@ pipeline_table_mtr_profile_delete(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -2033,8 +2001,6 @@ pipeline_table_rule_mtr_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -2092,8 +2058,6 @@ pipeline_table_dscp_table_update(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -2160,8 +2124,6 @@ pipeline_table_rule_ttl_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
@@ -2225,8 +2187,6 @@ pipeline_table_rule_time_read(const char *pipeline_name,
 
 	/* Send request and wait for response */
 	rsp = pipeline_msg_send_recv(p, req);
-	if (rsp == NULL)
-		return -1;
 
 	/* Read response */
 	status = rsp->status;
-- 
2.21.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ip_pipeline: fix resource leak for pipeline
  2020-04-27 16:57 [dpdk-dev] [PATCH] examples/ip_pipeline: fix resource leak for pipeline Jasvinder Singh
@ 2020-05-24 16:18 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2020-05-24 16:18 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dev, cristian.dumitrescu

27/04/2020 18:57, Jasvinder Singh:
> For sending request messages to data plane threads, the
> caller invokes pipeline_msg_send_recv() function which never
> returns null response. Thus, removed redundant check on
> the returned response.
> 
> Coverity Issues: 357750, 357740, 357749, 357758, 357702, 357736,
> 357679, 357791, 357738, 357778, 357716, 357705, 357776, 357753,
> 357729, 357735
> 
> Fixes: 50e73d051806 ("examples/ip_pipeline: add stats read commands")
> Fixes: 6b1b3c3c9d30 ("examples/ip_pipeline: add port enable and disable commands")
> Fixes: a3a95b7d58b9 ("examples/ip_pipeline: add table entry commands")
> Fixes: 3186282f8e12 ("examples/ip_pipeline: add table bulk add command")
> Fixes: f634e4c5698a ("examples/ip_pipeline: add table entry delete command")
> Fixes: c64b9121a963 ("examples/ip_pipeline: add table entry stats command")
> Fixes: 7e11393e40ef ("examples/ip_pipeline: add meter profile commands")
> Fixes: e92058d604e6 ("examples/ip_pipeline: add meter stats command")
> Fixes: 2b82ef4861c0 ("examples/ip_pipeline: add DSCP table update command")
> Fixes: d0d306c7f2a1 ("examples/ip_pipeline: add TTL stats command")
> Fixes: a3169ee5ec59 ("examples/ip_pipeline: support rule time read")
> 
> 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 thread".




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-24 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 16:57 [dpdk-dev] [PATCH] examples/ip_pipeline: fix resource leak for pipeline Jasvinder Singh
2020-05-24 16:18 ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git