mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +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:
committed by
Alan C. Assis
parent
2aaaa7632f
commit
0f918c8d4d
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user