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 <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
1e823a077c
commit
f914bc8ef2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue