Skip to contentSkip to conversation

bus/auxiliary: fix auxiliary device port destruction

PATCH Applied Gregory Etelson 2 participants 2 messages Jul 7, 2025 – Jul 9, 2025

lore
Share & tools
lore
#0 lore raw

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.

Fixes 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
---
 drivers/bus/auxiliary/auxiliary_common.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/bus/auxiliary/auxiliary_common.c +2 -0
index 5c6c6b0ef2..ac766e283e 100644
@@ -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
#1 lore raw

07/07/2025 12:06, Gregory Etelson:

Quoted 9 lines

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.

Quoted 8 lines

The patch validates auxiliary device driver before accessing driver related resources.

Fixes 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")

Applied, thanks.