[v2,1/3] net/enic: fix flow API memory leak

Message ID 20180928030838.15887-1-johndale@cisco.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2,1/3] net/enic: fix flow API memory leak |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

John Daley (johndale) Sept. 28, 2018, 3:08 a.m. UTC
  rte_flow structures were not being freed when destroyed or flushed.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
---
v2: fix signoff

 drivers/net/enic/enic_flow.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ferruh Yigit Oct. 2, 2018, 2:49 p.m. UTC | #1
On 9/28/2018 4:08 AM, John Daley wrote:
> rte_flow structures were not being freed when destroyed or flushed.
> 
> Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>

Series applied to dpdk-next-net/master, thanks.

(Patch 3/3 merged into 2/3 while merging, to keep relevant documentation and
implementation is same patch.)
  

Patch

diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 0cf04aefd..9b612f1d5 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -1532,6 +1532,7 @@  enic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
 	enic_flow_del_filter(enic, flow->enic_filter_id, error);
 	LIST_REMOVE(flow, next);
 	rte_spinlock_unlock(&enic->flows_lock);
+	rte_free(flow);
 	return 0;
 }
 
@@ -1555,6 +1556,7 @@  enic_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error)
 		flow = LIST_FIRST(&enic->flows);
 		enic_flow_del_filter(enic, flow->enic_filter_id, error);
 		LIST_REMOVE(flow, next);
+		rte_free(flow);
 	}
 	rte_spinlock_unlock(&enic->flows_lock);
 	return 0;