[ofw] [patch][core][al] Acquire the mad_lock before accessing the mad_list in __free_mads

Irena Gannon irena at mellanox.co.il
Thu Feb 17 05:28:02 PST 2011


Signed-off-by: Irena Gannon (irena at mellanox.co.il<mailto:irena at mellanox.co.il>)

Acquire the mad_lock before accessing the mad_list in __free_mads

Index: B:/users/irena/proj1/trunk/core/al/al.c
===================================================================
--- B:/users/irena/proj1/trunk/core/al/al.c          (revision 6997)
+++ B:/users/irena/proj1/trunk/core/al/al.c       (revision 6998)
@@ -132,6 +132,7 @@
                ib_api_status_t                                                status;

                /* Return all outstanding MADs to their MAD pools. */
+             cl_spinlock_acquire( &h_al->mad_lock);
                for( p_list_item = cl_qlist_head( &h_al->mad_list );
                                 p_list_item != cl_qlist_end( &h_al->mad_list );
                                 p_list_item = cl_qlist_head( &h_al->mad_list ) )
@@ -147,6 +148,7 @@
                                                                ib_get_err_str(status)) );
                                }
                }
+             cl_spinlock_release( &h_al->mad_lock);
 }


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110217/a2c4d253/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: free_mads.patch
Type: application/octet-stream
Size: 671 bytes
Desc: free_mads.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110217/a2c4d253/attachment.obj>


More information about the ofw mailing list