numam-dpdk/drivers/bus
Zhangfei Gao 3f27defe0c bus/vdev: fix crash in device cleanup
vdev_probe calls driver->probe and set dev->device.driver,
which will be NULL if the probe fails.

In vdev_cleanup, drv = container_of(dev->device.driver)
drv will be !NULL in this case, causing drv->remove
Segmentation fault.

Fixed by checking dev->device.driver before.

Log:
$ sudo dpdk-test --vdev=crypto_uadk --log-level=6
vdev_probe(): failed to initialize crypto_uadk device
EAL: Bus (vdev) probe failed.
RTE>>quit
Segmentation fault

Fixes: 1cab1a40ea ("bus: cleanup devices on shutdown")

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-10-20 11:35:07 +02:00
..
auxiliary drivers/bus: set device NUMA node to unknown by default 2022-10-06 21:26:55 +02:00
dpaa bus/dpaa: move mempool registration before probing 2022-10-07 17:19:03 +02:00
fslmc bus/fslmc: add timeout in MC send command 2022-10-07 17:19:03 +02:00
ifpga bus: hide bus object 2022-09-23 16:14:34 +02:00
pci bus/pci: fix memory leak in device cleanup 2022-10-20 11:34:55 +02:00
vdev bus/vdev: fix crash in device cleanup 2022-10-20 11:35:07 +02:00
vmbus drivers/bus: set device NUMA node to unknown by default 2022-10-06 21:26:55 +02:00
meson.build bus/auxiliary: introduce auxiliary bus 2021-07-05 18:11:28 +02:00