[dpdk-dev] [PATCHv4 2/9] null: fix segfault when null_pmd added to bonding

Tetsuya Mukawa mukawa at igel.co.jp
Wed Sep 30 03:24:39 CEST 2015


On 2015/09/30 0:10, Kulasek, TomaszX wrote:
> Hi Tetsuya,
>
> Changes from patch below, solves the problem. I've removed malloc.
>
> Tomasz.
>
> ---
> From e03e77a7dc0e47ac9d750545a834624f88f61966 Mon Sep 17 00:00:00 2001
> From: Tomasz Kulasek <tomaszx.kulasek at intel.com>
> Date: Tue, 29 Sep 2015 16:48:31 +0200
> Subject: [PATCH 1/4] null: fix segfault when null_pmd added to bonding
>
> ---
>  drivers/net/null/rte_eth_null.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
> index e244595..b498ef1 100644
> --- a/drivers/net/null/rte_eth_null.c
> +++ b/drivers/net/null/rte_eth_null.c
> @@ -432,6 +432,7 @@ eth_dev_null_create(const char *name,
>  	internals->numa_node = numa_node;
>  
>  	pci_dev->numa_node = numa_node;
> +	pci_dev->driver = &rte_null_pmd.pci_drv;
>  
>  	data->dev_private = internals;
>  	data->port_id = eth_dev->data->port_id;
> @@ -445,6 +446,7 @@ eth_dev_null_create(const char *name,
>  	eth_dev->dev_ops = &ops;
>  	eth_dev->pci_dev = pci_dev;
>  	eth_dev->driver = &rte_null_pmd;
> +	TAILQ_INIT(&eth_dev->link_intr_cbs);
>  
>  	/* finally assign rx and tx ops */
>  	if (packet_copy) {
> @@ -461,6 +463,7 @@ error:
>  	rte_free(data);
>  	rte_free(pci_dev);
>  	rte_free(internals);
> +	rte_free(eth_dev);

Hi Tomasz,

We can remove rte_free(eth_dev), because if eth_dev is allocated
correctly, we cannot reach here.
I don't see any issues except for it.

Thanks,
Tetsuya



More information about the dev mailing list