[1/2] lpm: fix free of data structure
diff mbox series

Message ID 20200907081518.46350-2-ruifeng.wang@arm.com
State Superseded
Delegated to: David Marchand
Headers show
Series
  • LPM changes
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ruifeng Wang Sept. 7, 2020, 8:15 a.m. UTC
The container structure should be freed instead of rte_lpm structure
after wrapping rte_lpm into internal structure __rte_lpm.

Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 lib/librte_lpm/rte_lpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bruce Richardson Sept. 15, 2020, 3:55 p.m. UTC | #1
On Mon, Sep 07, 2020 at 04:15:16PM +0800, Ruifeng Wang wrote:
> The container structure should be freed instead of rte_lpm structure
> after wrapping rte_lpm into internal structure __rte_lpm.
> 
> Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> ---
>  lib/librte_lpm/rte_lpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
> index 757436f49..51a0ae578 100644
> --- a/lib/librte_lpm/rte_lpm.c
> +++ b/lib/librte_lpm/rte_lpm.c
> @@ -268,7 +268,7 @@ rte_lpm_free(struct rte_lpm *lpm)
>  		rte_rcu_qsbr_dq_delete(internal_lpm->dq);
>  	rte_free(lpm->tbl8);
>  	rte_free(lpm->rules_tbl);
> -	rte_free(lpm);
> +	rte_free(internal_lpm);
>  	rte_free(te);
>  }
>  
> -- 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Medvedkin, Vladimir Sept. 15, 2020, 4:25 p.m. UTC | #2
On 07/09/2020 09:15, Ruifeng Wang wrote:
> The container structure should be freed instead of rte_lpm structure
> after wrapping rte_lpm into internal structure __rte_lpm.
> 
> Fixes: 8a9f8564e9f9 ("lpm: implement RCU rule reclamation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> ---
>   lib/librte_lpm/rte_lpm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
> index 757436f49..51a0ae578 100644
> --- a/lib/librte_lpm/rte_lpm.c
> +++ b/lib/librte_lpm/rte_lpm.c
> @@ -268,7 +268,7 @@ rte_lpm_free(struct rte_lpm *lpm)
>   		rte_rcu_qsbr_dq_delete(internal_lpm->dq);
>   	rte_free(lpm->tbl8);
>   	rte_free(lpm->rules_tbl);
> -	rte_free(lpm);
> +	rte_free(internal_lpm);
>   	rte_free(te);
>   }
>   
> 

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

Patch
diff mbox series

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 757436f49..51a0ae578 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -268,7 +268,7 @@  rte_lpm_free(struct rte_lpm *lpm)
 		rte_rcu_qsbr_dq_delete(internal_lpm->dq);
 	rte_free(lpm->tbl8);
 	rte_free(lpm->rules_tbl);
-	rte_free(lpm);
+	rte_free(internal_lpm);
 	rte_free(te);
 }