[IBAL] Fix crash when creating a MAD service with duplicate
[mirror/winof/.git] / core / al / al_mad.c
index 6c9d1e7..a76b7eb 100644 (file)
@@ -1256,13 +1256,16 @@ __destroying_mad_svc(
         * Since the MAD service is being destroyed, the user cannot be issuing\r
         * sends.\r
         */\r
+       if( h_mad_svc->h_mad_reg )\r
+       {\r
 #ifdef CL_KERNEL\r
-       old_irql = KeRaiseIrqlToDpcLevel();\r
+               old_irql = KeRaiseIrqlToDpcLevel();\r
 #endif\r
-       __check_send_queue( h_mad_svc );\r
+               __check_send_queue( h_mad_svc );\r
 #ifdef CL_KERNEL\r
-       KeLowerIrql( old_irql );\r
+               KeLowerIrql( old_irql );\r
 #endif\r
+       }\r
 \r
        cl_timer_destroy( &h_mad_svc->send_timer );\r
 \r