[12/20] net/ice: goto clean up lable to avoid memory leak

Message ID tencent_61C69CF0409C524458EA707D5F8EA088040A@qq.com (mailing list archive)
State Changes Requested, archived
Delegated to: David Marchand
Headers
Series fix memory leaks in error handling |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Weiguo Li Feb. 22, 2022, 6:18 p.m. UTC
  When function return in this branch, the memories of 'input' and 'rule'
are not released, goto corresponding lable to do the clean up.

Fixes: 40d466fa9f765b ("net/ice: support ACL filter in DCF")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
---
 drivers/net/ice/ice_acl_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c
index 8fe6f5aeb0..5ddc5262d4 100644
--- a/drivers/net/ice/ice_acl_filter.c
+++ b/drivers/net/ice/ice_acl_filter.c
@@ -530,7 +530,7 @@  ice_acl_create_filter(struct ice_adapter *ad,
 				   RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 				   "failed to set hw configure.");
 		ret = -rte_errno;
-		return ret;
+		goto err_acl_set_input;
 	}
 
 	if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_OTHER) {