- Fix a potential crash in IoGetLowerDeviceObject if nothing is attached to us

svn path=/trunk/; revision=41249
This commit is contained in:
Cameron Gutman 2009-06-02 01:34:12 +00:00
parent e4a0b00377
commit e640466446

View file

@ -1186,8 +1186,12 @@ IoGetLowerDeviceObject(IN PDEVICE_OBJECT DeviceObject)
/* Get the Lower Device Object */
LowerDeviceObject = DeviceExtension->AttachedTo;
/* Reference it */
ObReferenceObject(LowerDeviceObject);
/* Check that we got a valid device object */
if (LowerDeviceObject)
{
/* We did so let's reference it */
ObReferenceObject(LowerDeviceObject);
}
}
/* Return it */