RHBZ#2075862: VirtIO-FS: prevent Stop from accessing already deleted FileSystem
FileSystem in Stop() may be deleted already if the device is removed.
@@ -279,13 +279,14 @@ static DWORD VirtFsRegDevHandleNotification(VIRTFS *VirtFs)
VOID VIRTFS::Stop()
{
- FspFileSystemStopDispatcher(FileSystem);
-
- if (FileSystem != NULL)
+ if (FileSystem == NULL)
{
+ return;
+ }
+
+ FspFileSystemStopDispatcher(FileSystem);
FspFileSystemDelete(FileSystem);
FileSystem = NULL;
- }
LookupMap.clear();
