Signed-off-by: Irena Gannon ([email protected]<mailto:[email protected]>)
This patch:
1. Adds ref to h_pool in both success and error flows of reg_mad_pool as it is
dereferenced in __cleanup_pool_key in both flows as well
2. Prevents trying to remove a pool_item from a list if it was not inserted
into it
Index: B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c
===================================================================
--- B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c (revision 6890)
+++ B:/users/irena/proj1/trunk/core/al/kernel/al_mad_pool.c (revision 6891)
@@ -366,6 +366,10 @@
return status;
}
+ //add ref to h_pool which is dereferenced in __cleanup_pool_key
+ //in both success and error flow
+ ref_al_obj( &h_pool->obj );
+
/* Register the pool on the protection domain. */
if( key_type == AL_KEY_NORMAL )
{
@@ -420,8 +424,6 @@
/* Add this pool_key to the AL instance. */
al_insert_key( h_al, p_pool_key );
- ref_al_obj( &h_pool->obj );
-
/*
* Take a reference on the global pool_key for this CA, if it
exists.
* Note that the pool_key does not exist for the global MAD
pool in
@@ -528,7 +530,7 @@
* Remove the pool key from the pool to prevent further
registrations
* against this pool.
*/
- if( p_pool_key->type == AL_KEY_NORMAL )
+ if( p_pool_key->type == AL_KEY_NORMAL &&
p_pool_key->pool_item.p_next != NULL)
{
cl_spinlock_acquire(
&p_pool_key->h_pool->obj.lock );
cl_qlist_remove_item(
&p_pool_key->h_pool->key_list,
Thank you,
Irena
al_mad_pool.patch
Description: al_mad_pool.patch
_______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
