[ofa-general] [PATCH] opensm/osm_ucast_lash.(h c): Replace memoryallocation by array

Diego Guella diego.guella at sircomtech.com
Wed Jun 17 23:24:50 PDT 2009


Hi Hal,

>From: "Hal Rosenstock"
> @@ -778,11 +776,7 @@ static int init_lash_structures(lash_t * p_lash)
>  }
> 
>  /* initialise num_mst_in_lane[num_switches], default 0 */
> - p_lash->num_mst_in_lane = (int *)malloc(num_switches * sizeof(int));
> - if (p_lash->num_mst_in_lane == NULL)
> - goto Exit_Mem_Error;
> - memset(p_lash->num_mst_in_lane, 0,
> -        num_switches * sizeof(p_lash->num_mst_in_lane[0]));
> + memset(p_lash->num_mst_in_lane, 0, IB_MAX_NUM_VLS);
Should it be
memset(p_lash->num_mst_in_lane, 0, IB_MAX_NUM_VLS * sizeof(p_lash->num_mst_in_lane[0]));
?




More information about the general mailing list