net/vhost: fix double free of MAC addrs

Message ID 201812190440.wBJ4cabt027283@ccmail04.silk.ntt-tx.co.jp (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/vhost: fix double free of MAC addrs |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Hideyuki Yamashita Dec. 19, 2018, 4:37 a.m. UTC
  The common data freeing has been moved to rte_eth_dev_release_port(),
so freeing mac_addrs like this in eth_dev_close() is unnecessary and
will cause double free.

Fixes: e16adf08e54d ("ethdev: free all common data when releasing port")
Cc: stable@dpdk.org

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 drivers/net/vhost/rte_eth_vhost.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Tiwei Bie Dec. 19, 2018, 9:15 a.m. UTC | #1
On Wed, Dec 19, 2018 at 01:37:18PM +0900, Hideyuki Yamashita wrote:
> The common data freeing has been moved to rte_eth_dev_release_port(),
> so freeing mac_addrs like this in eth_dev_close() is unnecessary and
> will cause double free.
> 
> Fixes: e16adf08e54d ("ethdev: free all common data when releasing port")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
> Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
> ---
>  drivers/net/vhost/rte_eth_vhost.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
> index 42bdfcbd5..b2cda0483 100644
> --- a/drivers/net/vhost/rte_eth_vhost.c
> +++ b/drivers/net/vhost/rte_eth_vhost.c
> @@ -1000,7 +1000,6 @@ eth_dev_close(struct rte_eth_dev *dev)
>  		for (i = 0; i < dev->data->nb_tx_queues; i++)
>  			rte_free(dev->data->tx_queues[i]);
>  
> -	rte_free(dev->data->mac_addrs);
>  	free(internal->dev_name);
>  	free(internal->iface_name);
>  	rte_free(internal);
> -- 
> 2.18.0

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
  
Maxime Coquelin Dec. 20, 2018, 6:20 p.m. UTC | #2
On 12/19/18 5:37 AM, Hideyuki Yamashita wrote:
> The common data freeing has been moved to rte_eth_dev_release_port(),
> so freeing mac_addrs like this in eth_dev_close() is unnecessary and
> will cause double free.
> 
> Fixes: e16adf08e54d ("ethdev: free all common data when releasing port")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
> Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
> ---
>   drivers/net/vhost/rte_eth_vhost.c | 1 -
>   1 file changed, 1 deletion(-)
> 

Applied to dpdk-next-virtio.

Maxime
  

Patch

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 42bdfcbd5..b2cda0483 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1000,7 +1000,6 @@  eth_dev_close(struct rte_eth_dev *dev)
 		for (i = 0; i < dev->data->nb_tx_queues; i++)
 			rte_free(dev->data->tx_queues[i]);
 
-	rte_free(dev->data->mac_addrs);
 	free(internal->dev_name);
 	free(internal->iface_name);
 	rte_free(internal);