net/softnic: fix memory leak as profile is freed

Message ID 20210713082709.465481-1-dapengx.yu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Andrew Rybchenko
Headers
Series net/softnic: fix memory leak as profile is freed |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing fail Testing issues
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance fail Performance Testing issues
ci/intel-Testing success Testing PASS

Commit Message

Yu, DapengX July 13, 2021, 8:27 a.m. UTC
  From: Dapeng Yu <dapengx.yu@intel.com>

In function softnic_table_action_profile_free(), the memory referenced
by pointer "ap" in the instance of "struct softnic_table_action_profile"
is not freed.

This patch fixes it.

Fixes: a737dd4e5863 ("net/softnic: add table action profile")
Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_action.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jasvinder Singh July 14, 2021, 11:17 a.m. UTC | #1
> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Tuesday, July 13, 2021 9:27 AM
> To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; Yu, DapengX <dapengx.yu@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/softnic: fix memory leak as profile is freed
> 
> From: Dapeng Yu <dapengx.yu@intel.com>
> 
> In function softnic_table_action_profile_free(), the memory referenced by
> pointer "ap" in the instance of "struct softnic_table_action_profile"
> is not freed.
> 
> This patch fixes it.
> 
> Fixes: a737dd4e5863 ("net/softnic: add table action profile")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> ---
>  drivers/net/softnic/rte_eth_softnic_action.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/softnic/rte_eth_softnic_action.c
> b/drivers/net/softnic/rte_eth_softnic_action.c
> index 92c744dc9a..33be9552a6 100644
> --- a/drivers/net/softnic/rte_eth_softnic_action.c
> +++ b/drivers/net/softnic/rte_eth_softnic_action.c
> @@ -183,6 +183,7 @@ softnic_table_action_profile_free(struct
> pmd_internals *p)
>  			break;
> 
>  		TAILQ_REMOVE(&p->table_action_profile_list, profile,
> node);
> +		rte_table_action_profile_free(profile->ap);
>  		free(profile);
>  	}
>  }
> --
> 2.27.0

Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
  

Patch

diff --git a/drivers/net/softnic/rte_eth_softnic_action.c b/drivers/net/softnic/rte_eth_softnic_action.c
index 92c744dc9a..33be9552a6 100644
--- a/drivers/net/softnic/rte_eth_softnic_action.c
+++ b/drivers/net/softnic/rte_eth_softnic_action.c
@@ -183,6 +183,7 @@  softnic_table_action_profile_free(struct pmd_internals *p)
 			break;
 
 		TAILQ_REMOVE(&p->table_action_profile_list, profile, node);
+		rte_table_action_profile_free(profile->ap);
 		free(profile);
 	}
 }