From f914bc8ef2cdb9ee75494a7c18baa16b63f78cfc Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 5 Oct 2024 20:05:50 +0800 Subject: [PATCH] driver/vhost: Check driver is NULL before calling probe to avoid the same device bind to multiple drivers at the same time Signed-off-by: Xiang Xiao --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 1a97b5c0f2..52a55f6a64 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -181,7 +181,7 @@ int vhost_register_driver(FAR struct vhost_driver *driver) list_for_every_entry(&g_vhost_bus.device, item, struct vhost_device_item_s, node) { - if (driver->device == item->device->id.device) + if (item->driver == NULL && driver->device == item->device->id.device) { /* If found the device in the device list, call driver probe, * if probe success, assign item->driver to indicate the device