numam-dpdk/drivers
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
..
baseband drivers/baseband: expose per operation type queues 2022-10-07 08:44:58 +02:00
bus bus/vdev: fix crash in device cleanup 2022-10-20 11:35:07 +02:00
common build: increase minimum meson version to 0.53.2 2022-10-10 16:52:38 +02:00
compress dev: hide driver object 2022-09-23 16:14:34 +02:00
crypto crypto/ipsec_mb: support all tag sizes for ZUC-EIA3-256 2022-10-07 19:46:11 +02:00
dma dma/idxd: check DSA device allocation 2022-10-10 17:53:18 +02:00
event drivers: mark SW PMDs to support disabling IOVA as PA 2022-10-09 13:14:57 +02:00
gpu dev: hide driver object 2022-09-23 16:14:34 +02:00
mempool drivers: mark SW PMDs to support disabling IOVA as PA 2022-10-09 13:14:57 +02:00
net net/mana: fix dependencies 2022-10-11 01:34:07 +02:00
raw drivers: mark SW PMDs to support disabling IOVA as PA 2022-10-09 13:14:57 +02:00
regex regex/mlx5: forbid changing maximum match number 2022-10-09 16:33:32 +02:00
vdpa vdpa/sfc: support multi-queue 2022-10-04 17:23:58 +02:00
meson.build build: introduce deprecated libraries 2022-10-10 17:01:56 +02:00