[SRP] fixes the BSOD when SRPT disconnects.
[mirror/winof/.git] / ulp / srp / kernel / srp_session.c
index 0f547d5..c9dfdd2 100644 (file)
@@ -58,7 +58,15 @@ __srp_destroying_session(
 \r
        p_srp_session = PARENT_STRUCT( p_obj, srp_session_t, obj );\r
 \r
+       cl_obj_lock( &p_srp_session->obj );\r
+       if( p_srp_session->connection.state != SRP_CONNECT_FAILURE )\r
+       {\r
+               cl_obj_unlock( &p_srp_session->obj );\r
+               return;\r
+       }\r
+\r
        p_srp_session->connection.state = SRP_CONNECTION_CLOSING;\r
+       cl_obj_unlock( &p_srp_session->obj );\r
 \r
        SRP_PRINT( TRACE_LEVEL_VERBOSE, SRP_DBG_DEBUG,\r
                ("Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );\r