Skip to content

Commit

Permalink
bus/vdev: check result of rte_vdev_device_name
Browse files Browse the repository at this point in the history
In rte_eth_vdev_allocate result of call to rte_vdev_device_name is
dereferenced here and may be null.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
Sinan Kaya authored and ovsrobot committed Jul 10, 2023
1 parent f351206 commit e46070d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ethdev/ethdev_vdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

eth_dev = rte_eth_dev_allocate(name);
if (!eth_dev)
Expand Down

0 comments on commit e46070d

Please sign in to comment.