[ofa-general] RE: [PATCH] opensm: skeleton for toroidal mesh analysis

Robert Pearson rpearson at systemfabricworks.com
Sun Nov 30 10:58:49 PST 2008


You wrote:
> @@ -872,10 +821,15 @@ static int lash_core(lash_t * p_lash)
>  	int output_link2, i_next_switch2;
>  	int cycle_found2 = 0;
>  	int status = 0;
> -	int *switch_bitmap;	/* Bitmap to check if we have processed this
> pair */
> +	int *switch_bitmap = NULL;	/* Bitmap to check if we have
> processed this pair */

Why this initialization is needed?

The added code can fail which will cause a goto to Exit. At Exit
switch_bitmap is freed if it is not zero. The added initialization makes
sure it is zero.



More information about the general mailing list