[openib-general] [PATCH] [TRIVIAL] OpenSM/complib: Move assert before variable is used

Johannes Erdfelt johannes at erdfelt.com
Wed Nov 30 14:32:37 PST 2005


On Wed, Nov 30, 2005, Hal Rosenstock <halr at voltaire.com> wrote:
> OpenSM/complib: Move assert before variable is used
> 
> Signed-off-by: Hal Rosenstock <halr at voltaire.com>
> 
> Index: cl_dispatcher.c
> ===================================================================
> --- cl_dispatcher.c     (revision 4257)
> +++ cl_dispatcher.c     (working copy)
> @@ -344,8 +344,8 @@ cl_disp_post(
>    cl_dispatcher_t    *p_disp;
>    cl_disp_msg_t      *p_msg;
>  
> -  p_disp = handle->p_disp;
>    CL_ASSERT( p_disp );
> +  p_disp = handle->p_disp;
>    CL_ASSERT( msg_id != CL_DISP_MSGID_NONE );
>  
>    cl_spinlock_acquire( &p_disp->lock );

It can't be correct to check the value before it is set, right?

JE




More information about the general mailing list