From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA43AA00BE; Mon, 27 Apr 2020 19:15:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 232291C246; Mon, 27 Apr 2020 19:15:56 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0AA6B1C21C for ; Mon, 27 Apr 2020 19:15:53 +0200 (CEST) IronPort-SDR: FYqJxopXHEuGtePtZADjRAM/x2sV4RWDAQKtUtfIiS5cUbJ3XLH3vo0oUiUOB+U1yWBOUHKmLr 57dpcCQQKfZg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 10:15:53 -0700 IronPort-SDR: uNxw3VyaG1wwcPVOgGAyz5biRrDDeM31JdrIvbPh0ytCxQZyCmNgfO0NHZtHBwx8xQyfQL3ys3 jWTpjhtpfR/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,324,1583222400"; d="scan'208";a="257334142" Received: from silpixa00400517.ir.intel.com ([10.237.214.174]) by orsmga003.jf.intel.com with ESMTP; 27 Apr 2020 10:15:52 -0700 From: Jasvinder Singh To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com Date: Mon, 27 Apr 2020 18:15:51 +0100 Message-Id: <20200427171551.82235-1-jasvinder.singh@intel.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200427140325.83191-1-jasvinder.singh@intel.com> References: <20200427140325.83191-1-jasvinder.singh@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/softnic: fix resource leak for pipeline X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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: 357676, 357680, 357681, 357682, 357690, 357693, 357711, 357722, 357725, 357734, 357739, 357743, 357747,357762, 357766, 357787 Fixes: 6d4d05402501 ("net/softnic: add command to read stats") Fixes: 202905f3ee4d ("net/softnic: add command to create objects") Fixes: ee19326a4b1e ("net/softnic: add command for pipeline table entries") Fixes: 9bc0ce0ad17c ("net/softnic: add command for meter action") Fixes: 2505030a8383 ("net/softnic: add command for TTL action") Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- drivers/net/softnic/rte_eth_softnic_thread.c | 34 -------------------- 1 file changed, 34 deletions(-) diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c index d61846e03..dcfb5eb82 100644 --- a/drivers/net/softnic/rte_eth_softnic_thread.c +++ b/drivers/net/softnic/rte_eth_softnic_thread.c @@ -835,8 +835,6 @@ softnic_pipeline_port_in_stats_read(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -884,8 +882,6 @@ softnic_pipeline_port_in_enable(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -931,8 +927,6 @@ softnic_pipeline_port_in_disable(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -986,8 +980,6 @@ softnic_pipeline_port_out_stats_read(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1043,8 +1035,6 @@ softnic_pipeline_table_stats_read(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1323,8 +1313,6 @@ softnic_pipeline_table_rule_add(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1407,8 +1395,6 @@ softnic_pipeline_table_rule_add_default(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1565,8 +1551,6 @@ softnic_pipeline_table_rule_add_bulk(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1630,8 +1614,6 @@ softnic_pipeline_table_rule_delete(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1680,8 +1662,6 @@ softnic_pipeline_table_rule_delete_default(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1740,8 +1720,6 @@ softnic_pipeline_table_rule_stats_read(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1821,10 +1799,6 @@ softnic_pipeline_table_mtr_profile_add(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) { - free(mp); - return -1; - } /* Read response */ status = rsp->status; @@ -1880,8 +1854,6 @@ softnic_pipeline_table_mtr_profile_delete(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1943,8 +1915,6 @@ softnic_pipeline_table_rule_mtr_read(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2008,8 +1978,6 @@ softnic_pipeline_table_dscp_table_update(struct pmd_internals *softnic, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2073,8 +2041,6 @@ softnic_pipeline_table_rule_ttl_read(struct pmd_internals *softnic, /* 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