Author: tkreuzer
Date: Sun Jul 22 18:48:09 2012
New Revision: 56939
URL:
http://svn.reactos.org/svn/reactos?rev=56939&view=rev
Log:
[NTOSKNRL]
Add a missing NULL check in IoShutdownSystem
Modified:
trunk/reactos/ntoskrnl/io/iomgr/device.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c [iso-8859-1] Sun Jul 22 18:48:09 2012
@@ -136,10 +136,10 @@
PIRP Irp;
KEVENT Event;
NTSTATUS Status;
-
+
/* Initialize an event to wait on */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
-
+
/* What phase? */
if (Phase == 0)
{
@@ -167,11 +167,14 @@
NULL,
&Event,
&StatusBlock);
- Status = IoCallDriver(DeviceObject, Irp);
- if (Status == STATUS_PENDING)
+ if (Irp)
{
- /* Wait on the driver */
- KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
+ Status = IoCallDriver(DeviceObject, Irp);
+ if (Status == STATUS_PENDING)
+ {
+ /* Wait on the driver */
+ KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE,
NULL);
+ }
}
/* Remove the flag */
@@ -202,7 +205,7 @@
/* Shutdown tape filesystems */
IopShutdownBaseFileSystems(&IopTapeFileSystemQueueHead);
-
+
/* Loop last-chance shutdown notifications */
ListEntry = ExInterlockedRemoveHeadList(&LastChanceShutdownListHead,
&ShutdownListLock);
@@ -889,7 +892,7 @@
/* Set the Type and Size. Question: why is Size 0 on Windows? */
DeviceObjectExtension->Type = IO_TYPE_DEVICE_OBJECT_EXTENSION;
DeviceObjectExtension->Size = 0;
-
+
/* Initialize with Power Manager */
PoInitializeDeviceObject(DeviceObjectExtension);
@@ -981,7 +984,7 @@
ASSERT((DriverObject->Flags & DRVO_UNLOAD_INVOKED) == 0);
CreatedDeviceObject->DriverObject = DriverObject;
IopEditDeviceList(DriverObject, CreatedDeviceObject, IopAdd);
-
+
/* Link with the power manager */
if (CreatedDeviceObject->Vpb) PoVolumeDevice(CreatedDeviceObject);
@@ -1402,7 +1405,7 @@
/* Set the DO */
Entry->DeviceObject = DeviceObject;
-
+
/* Reference it so it doesn't go away */
ObReferenceObject(DeviceObject);
@@ -1433,7 +1436,7 @@
/* Set the DO */
Entry->DeviceObject = DeviceObject;
-
+
/* Reference it so it doesn't go away */
ObReferenceObject(DeviceObject);
@@ -1457,7 +1460,7 @@
PSHUTDOWN_ENTRY ShutdownEntry;
PLIST_ENTRY NextEntry;
KIRQL OldIrql;
-
+
/* Remove the flag */
DeviceObject->Flags &= ~DO_SHUTDOWN_REGISTERED;
@@ -1480,7 +1483,7 @@
/* Free the entry */
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
-
+
/* Get rid of our reference to it */
ObDereferenceObject(DeviceObject);
}
@@ -1507,7 +1510,7 @@
/* Free the entry */
ExFreePoolWithTag(ShutdownEntry, TAG_SHUTDOWN_ENTRY);
-
+
/* Get rid of our reference to it */
ObDereferenceObject(DeviceObject);
}