Seems like it is superfluous sanity check.
But it is better to set ASSERT and to return p_cep->ref_cnt.

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Sean Hefty
> Sent: Friday, December 04, 2009 1:06 AM
> To: [email protected]
> Subject: [ofw] __cleanup_cep() oddity
> 
> __cleanup_cep() in al_cm_cep.c has the following fragment:
> 
>       /* If we've already come through here, we're done. */
>       if( p_cep->state == CEP_STATE_DESTROY ||
>               p_cep->state == CEP_STATE_DREQ_DESTROY )
>       {
>               AL_EXIT( AL_DBG_CM );
>               return -1;
>       }
> 
> Does anyone know *why* this check is here returns -1?
> 
> The other return path from this call decrements 
> p_cep->ref_cnt and returns that as the result.  This is used 
> in a couple of places to determine whether or not the destroy 
> callback should be invoked.
> 
> It seems odd that the code allows calling cleanup twice, with 
> different behavior and meaning to the return value.
> 
> - Sean
> 
> _______________________________________________
> ofw mailing list
> [email protected]
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 
_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to