bus/auxiliary: fix auxiliary device port destruction
PATCH 1/1 bus/auxiliary: fix auxiliary device port destruction
DPDK auxiliary bus first creates a list of known devices in the auxiliary_bus.device_list and then tries to attach a driver to each device on that list.
If the driver attachment has failed, a device will remain on the list.
The device destruction did not validate driver existence and crashed.
The patch validates auxiliary device driver before accessing driver related resources.
--- drivers/bus/auxiliary/auxiliary_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bus/auxiliary/auxiliary_common.c +2 -0
@@ -163,6 +163,8 @@ rte_auxiliary_driver_remove_dev(struct rte_auxiliary_device *dev)return -EINVAL ; drv = dev->driver; +if (drv ==NULL ) +return 0 ;AUXILIARY_LOG (DEBUG ,"Driver %s remove auxiliary device %s on NUMA node %i" , drv->driver.name, dev->name, dev->device.numa_node);
Signature · 1 line
2.48.1
Thomas Monjalon
Applied07/07/2025 12:06, Gregory Etelson:
Quoted 9 lines
DPDK auxiliary bus first creates a list of known devices in the
auxiliary_bus.device_listand then tries to attach a driver to each device on that list.If the driver attachment has failed, a device will remain on the list.
The device destruction did not validate driver existence and crashed.
Quoted 8 lines
The patch validates auxiliary device driver before accessing driver related resources.
Fixes 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")Signed-off-by Gregory Etelson <[email protected]>
Applied, thanks.