From: ftillier Date: Thu, 18 Aug 2005 18:40:19 +0000 (+0000) Subject: Fixed bug where objects would be left in their parent's child list even in X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=771eeddeae041a85589a33d11416c79a33a5d985;p=~shefty%2Frdma-win.git Fixed bug where objects would be left in their parent's child list even in case of error. This would lead to list corruption. git-svn-id: svn://openib.tc.cornell.edu/gen1@54 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/core/al/al_common.c b/trunk/core/al/al_common.c index 6b7999e2..ae93de10 100644 --- a/trunk/core/al/al_common.c +++ b/trunk/core/al/al_common.c @@ -291,7 +291,11 @@ attach_al_obj( p_child_obj->hdl = al_hdl_insert_obj( p_child_obj ); if( p_child_obj->hdl == AL_INVALID_HANDLE ) { + cl_spinlock_acquire( &p_parent_obj->lock ); + cl_qlist_remove_item( &p_parent_obj->obj_list, + (cl_list_item_t*)&p_child_obj->pool_item ); p_child_obj->p_parent_obj = NULL; + cl_spinlock_release( &p_parent_obj->lock ); return IB_INSUFFICIENT_MEMORY; } #endif