[ofa-general] Re: [PATCH] opensm: allow multiple scopes in a partition

Rolf Manderscheid rvm at obsidianresearch.com
Thu Nov 29 09:56:52 PST 2007


>>  
>> @@ -147,11 +162,13 @@ static int partition_add_flag(unsigned lineno, struct part_conf *conf,
>>  				"flag \'rate\' requires valid value"
>>  				" - skipped\n", lineno);
>>  	} else if (!strncmp(flag, "scope", len)) {
>> -		if (!val || (conf->scope = strtoul(val, NULL, 0)) == 0)
>> +		unsigned int scope;
>> +		if (!val || (scope = strtoul(val, NULL, 0)) == 0 || scope > 0xF)
>>  			osm_log(conf->p_log, OSM_LOG_VERBOSE,
>>  				"PARSE WARN: line %d: "
>>  				"flag \'scope\' requires valid value"
>>  				" - skipped\n", lineno);
>> +		conf->scope_mask |= (1<<scope);
>>     
>
> In case when val is NULL scope will be non-initialized and
> conf->scope_mask will get a wrong value. And in case of other errors
> too...
>   
Yes, there's obviously a missing else.  I'll repost right away.

    Rolf




More information about the general mailing list