[ofw] [patch][al] reg_mad_pool error flow
Smith, Stan
stan.smith at intel.com
Tue Nov 23 17:04:35 PST 2010
What degree of testing has been performed with this patch?
thanks,
stan.
________________________________
From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Irena Gannon
Sent: Tuesday, November 23, 2010 6:19 AM
To: 'ofw at lists.openfabrics.org'
Subject: [ofw] [patch][al] reg_mad_pool error flow
Signed-off-by: Irena Gannon (irena at mellanox.co.il<mailto:irena at mellanox.co.il>)
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101123/5b0dc99d/attachment.html>
More information about the ofw
mailing list