[PORTCLS]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 9 Jun 2010 13:27:19 +0000 (13:27 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 9 Jun 2010 13:27:19 +0000 (13:27 +0000)
- Check if resource list has been allocated

svn path=/trunk/; revision=47711

reactos/drivers/wdm/audio/backpln/portcls/irp.cpp

index f30f9de..35bc6b1 100644 (file)
@@ -118,11 +118,22 @@ PortClsPnp(
             // Clean up
             DPRINT("IRP_MN_REMOVE_DEVICE\n");
 
-            DeviceExt->resources->Release();
-            IoDeleteDevice(DeviceObject);
+            // sanity check
+            PC_ASSERT(DeviceExt);
+
+            // FIXME more cleanup */
+            if (DeviceExt->resources)
+            {
+                // free resource list */
+                DeviceExt->resources->Release();
+
+                // set to null
+                DeviceExt->resources = NULL;
+            }
 
             // Forward request
             Status = PcForwardIrpSynchronous(DeviceObject, Irp);
+
             return PcCompleteIrp(DeviceObject, Irp, Status);
 
         case IRP_MN_QUERY_INTERFACE: