- Set SurpriseRemovalOK flag when IRP_MN_QUERY_CAPABILITIES was handled successfully
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 4 Dec 2012 05:13:22 +0000 (05:13 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 4 Dec 2012 05:13:22 +0000 (05:13 +0000)
- CORE-6447

svn path=/trunk/; revision=57796

reactos/drivers/hid/hidusb/hidusb.c

index a805012..32a242f 100644 (file)
@@ -1686,10 +1686,13 @@ HidPnp(
                 Status = Irp->IoStatus.Status;
             }
 
-            //
-            // don't need to safely remove
-            //
-            IoStack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE;
+            if (NT_SUCCESS(Status) && IoStack->Parameters.DeviceCapabilities.Capabilities != NULL)
+            {
+                //
+                // don't need to safely remove
+                //
+                IoStack->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = TRUE;
+            }
 
             //
             // done