Device bus should be initialized after bus scan.
While it does not happened when scan vdev from secondary process,
that cause segment fault at rte_dev_probe when call dev->bus->xxx.

Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: sta...@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
---
 drivers/bus/vdev/vdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 0142fb2c8..7d658fdf7 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -222,6 +222,7 @@ insert_vdev(const char *name, const char *args, struct 
rte_vdev_device **p_dev)
                goto fail;
        }
 
+       dev->device.bus = &rte_vdev_bus;
        dev->device.devargs = devargs;
        dev->device.numa_node = SOCKET_ID_ANY;
        dev->device.name = devargs->name;
-- 
2.13.6

Reply via email to