[dpdk-dev] [PATCH v6 2/2] vhost: Add VHOST PMD

Tetsuya Mukawa mukawa at igel.co.jp
Wed Feb 3 08:48:17 CET 2016


On 2016/02/03 8:43, Ferruh Yigit wrote:
> On Tue, Feb 02, 2016 at 08:18:42PM +0900, Tetsuya Mukawa wrote:
>> +
>> +	/* find an ethdev entry */
>> +	eth_dev = rte_eth_dev_allocated(name);
>> +	if (eth_dev == NULL)
>> +		return -ENODEV;
>> +
>> +	internal = eth_dev->data->dev_private;
>> +
>> +	rte_free(vring_states[internal->port_id]);
>> +	vring_states[internal->port_id] = NULL;
>> +
>> +	pthread_mutex_lock(&internal_list_lock);
>> +	TAILQ_REMOVE(&internals_list, internal, next);
>> +	pthread_mutex_unlock(&internal_list_lock);
>> +
>> +	eth_dev_stop(eth_dev);
>> +
>> +	if ((internal) && (internal->dev_name))
> if "internal" can be NULL, above internal->port_id reference will crash, if can't be NULL no need to check here.
>
>

Hi Ferruh,

I guess if internal is NULL, "internal->dev_name" will not be accessed.
So it may be ok to stay above code.

Tetsuya


More information about the dev mailing list