Fixed bug where objects would be left in their parent's child list even in
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 18 Aug 2005 18:40:19 +0000 (18:40 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 18 Aug 2005 18:40:19 +0000 (18:40 +0000)
case of error.  This would lead to list corruption.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@54 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_common.c

index 6b7999e..ae93de1 100644 (file)
@@ -291,7 +291,11 @@ attach_al_obj(
                        p_child_obj->hdl = al_hdl_insert_obj( p_child_obj );\r
                        if( p_child_obj->hdl == AL_INVALID_HANDLE )\r
                        {\r
+                               cl_spinlock_acquire( &p_parent_obj->lock );\r
+                               cl_qlist_remove_item( &p_parent_obj->obj_list,\r
+                                       (cl_list_item_t*)&p_child_obj->pool_item );\r
                                p_child_obj->p_parent_obj = NULL;\r
+                               cl_spinlock_release( &p_parent_obj->lock );\r
                                return IB_INSUFFICIENT_MEMORY;\r
                        }\r
 #endif\r