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

Hal Rosenstock hal.rosenstock at gmail.com
Thu Jun 18 04:28:06 PDT 2009


Hi Diego,

On Thu, Jun 18, 2009 at 2:24 AM, Diego
Guella<diego.guella at sircomtech.com> wrote:
> 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]));
> ?

Good catch. v2 of this patch shortly.

-- Hal

> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit
> http://openib.org/mailman/listinfo/openib-general
>



More information about the general mailing list