[ofw] RE: PATCH: [ipoib] Fix releasing a lock too early.

Tzachi Dar tzachid at mellanox.co.il
Wed Nov 5 08:58:12 PST 2008


This was the bug. Please note that the lock is being freed two lines
after.

So in the case we didn't go to error the lock would get freed twice.

Thanks
Tzachi

> -----Original Message-----
> From: Sean Hefty [mailto:sean.hefty at intel.com] 
> Sent: Wednesday, November 05, 2008 6:54 PM
> To: Tzachi Dar; ofw at lists.openfabrics.org
> Subject: RE: PATCH: [ipoib] Fix releasing a lock too early.
> 
> >Index: Q:/projinf4/trunk/ulp/ipoib/kernel/ipoib_port.c
> >===================================================================
> >--- Q:/projinf4/trunk/ulp/ipoib/kernel/ipoib_port.c (revision 3429)
> >+++ Q:/projinf4/trunk/ulp/ipoib/kernel/ipoib_port.c (revision 3430)
> >@@ -5731,12 +5731,12 @@
> >   cl_memclr(&port_info, sizeof(port_info));
> >   port_info.base_lid = p_port->base_lid;
> >   status = __endpt_mgr_add_local( p_port, &port_info );
> >-  cl_obj_unlock( &p_port->obj );
> >   if( status != IB_SUCCESS )
> >   {
> >    IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
> >     ("__endpt_mgr_add_local returned %s\n",
> >     p_port->p_adapter->p_ifc->get_err_str( status )) );
> >+    cl_obj_unlock( &p_port->obj );
> >    goto err;
> >   }
> >  }
> 
> This looks wrong.  The lock went from being released all the 
> time to only released if not success.
> 
> - Sean
> 
> 



More information about the ofw mailing list