[openib-general] Re: [PATCH] Opensm - Fix bug in cl_event_wheel

Hal Rosenstock halr at voltaire.com
Thu Sep 22 06:18:31 PDT 2005


On Thu, 2005-09-22 at 07:45, Yael Kalka wrote:
> Hi Hal,
> 
> There is a bug in the init function of cl_event_wheel - initializing
> of spinlock inside CL_ASSERT.
> Attached is a patch to fix it.
> 
> Thanks,
> Yael
> 
> Index: complib/cl_event_wheel.c
> ===================================================================
> --- complib/cl_event_wheel.c	(revision 439)
                                            ^^^

What code base is this off of ?

> +++ complib/cl_event_wheel.c	(working copy)
> @@ -224,7 +224,14 @@ cl_event_wheel_init(
>    p_event_wheel->p_log = p_log;
>    p_event_wheel->p_external_lock = NULL;
>    p_event_wheel->closing = FALSE;
> -  CL_ASSERT( cl_spinlock_init( &(p_event_wheel->lock) ) == CL_SUCCESS );
> +  cl_status =  cl_spinlock_init( &(p_event_wheel->lock) );
> +  if (cl_status != CL_SUCCESS)
> +  {
> +    osm_log (p_event_wheel->p_log, OSM_LOG_ERROR,
> +             "cl_event_wheel_init : ERROR 1000: "
                                             ^^^^
This is a duplicate error number. I've committed this patch; just
indicate what error number to change this to.

> +             "Failed to initialize cl_spinlock\n" );
> +    goto Exit;
> +  }
>    cl_qlist_init( &p_event_wheel->events_wheel);
>    cl_qmap_init( &p_event_wheel->events_map );
>  
> @@ -237,8 +244,10 @@ cl_event_wheel_init(
>    {
>      osm_log (p_event_wheel->p_log, OSM_LOG_ERROR,
>               "cl_event_wheel_init : ERROR 1000: "
> -             "Failed to initialize timer\n" );
> +             "Failed to initialize cl_timer\n" );
> +    goto Exit;
>    }
> + Exit:
>    OSM_LOG_EXIT( p_event_wheel->p_log );
>    return(cl_status);
>  }

Again, please try and remember your signed off line.

-- Hal




More information about the general mailing list