[PATCH v3 10/10] bus/vdev: check result of rte_vdev_device_name

Stephen Hemminger stephen at networkplumber.org
Fri Jan 20 17:47:15 CET 2023


On Thu, 19 Jan 2023 23:41:40 -0500
okaya at kernel.org wrote:

> diff --git a/lib/ethdev/ethdev_vdev.h b/lib/ethdev/ethdev_vdev.h
> index 364f140f91..6d94a65d97 100644
> --- a/lib/ethdev/ethdev_vdev.h
> +++ b/lib/ethdev/ethdev_vdev.h
> @@ -34,6 +34,8 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)
>  {
>  	struct rte_eth_dev *eth_dev;
>  	const char *name = rte_vdev_device_name(dev);
> +	if (name == NULL)
> +		return NULL;


Please add a blank line after declarations and before code.
For some reason the DPDK version of checkpatch suppresses this warning.


More information about the dev mailing list