mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
pci/ivshmem: Check drv isn't NULL before calling remove
since the device mayn't bind to the driver yet Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
2aaaa7632f
commit
0f918c8d4d
1 changed files with 5 additions and 2 deletions
|
@ -187,8 +187,11 @@ static int ivshmem_unregister_device(FAR struct ivshmem_device_s *dev)
|
|||
* the device unmatched
|
||||
*/
|
||||
|
||||
dev->drv->remove(dev);
|
||||
dev->drv = NULL;
|
||||
if (dev->drv)
|
||||
{
|
||||
dev->drv->remove(dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue