[NDIS]
authorCameron Gutman <aicommander@gmail.com>
Wed, 18 Mar 2015 05:34:44 +0000 (05:34 +0000)
committerCameron Gutman <aicommander@gmail.com>
Wed, 18 Mar 2015 05:34:44 +0000 (05:34 +0000)
- Don't allow a miniport to register more than once for shutdown callbacks
- Fixes hang on shutdown with the BCM57XX driver

svn path=/trunk/; revision=66779

reactos/drivers/network/ndis/ndis/miniport.c

index 732fecb..53ca659 100644 (file)
@@ -1708,6 +1708,12 @@ NdisMRegisterAdapterShutdownHandler(
 
   NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
 
+  if (Adapter->BugcheckContext != NULL)
+  {
+      NDIS_DbgPrint(MIN_TRACE, ("Attempted to register again for a shutdown callback\n"));
+      return;
+  }
+
   BugcheckContext = ExAllocatePool(NonPagedPool, sizeof(MINIPORT_BUGCHECK_CONTEXT));
   if(!BugcheckContext)
     {