net/bonding: fix possible null pointer reference
In function check_for_bonded_ethdev the driver name is used without
validating the pointer references in the passed ethdev object.
Fixes: 740feaf349
("ethdev: remove driver name from device private data")
Cc: stable@dpdk.org
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
This commit is contained in:
parent
08fd782b84
commit
e6b8757bb7
@ -19,7 +19,10 @@ int
|
||||
check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev)
|
||||
{
|
||||
/* Check valid pointer */
|
||||
if (eth_dev->device->driver->name == NULL)
|
||||
if (eth_dev == NULL ||
|
||||
eth_dev->device == NULL ||
|
||||
eth_dev->device->driver == NULL ||
|
||||
eth_dev->device->driver->name == NULL)
|
||||
return -1;
|
||||
|
||||
/* return 0 if driver name matches */
|
||||
|
Loading…
Reference in New Issue
Block a user