[ofw] [patch][al] reg_mad_pool error flow
Irena Gannon
irena at mellanox.co.il
Tue Nov 23 06:19:28 PST 2010
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/aad7bdfa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: al_mad_pool.patch
Type: application/octet-stream
Size: 1231 bytes
Desc: al_mad_pool.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101123/aad7bdfa/attachment.obj>
More information about the ofw
mailing list