Re: [PATCH 2/2] Always allocate totemrrp stats array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ACK

On 04/06/2012 12:14 PM, Jan Friesse wrote:
> This prevents segfault when rrp mode is set with only one ring.
> 
> Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
> ---
>  exec/totemrrp.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/exec/totemrrp.c b/exec/totemrrp.c
> index 25ea90b..de6cd39 100644
> --- a/exec/totemrrp.c
> +++ b/exec/totemrrp.c
> @@ -1879,10 +1879,8 @@ int totemrrp_initialize (
>  
>  	instance->totem_config = totem_config;
>  	stats->rrp = &instance->stats;
> -	if (totem_config->interface_count > 1) {
> -		instance->stats.interface_count = totem_config->interface_count;
> -		instance->stats.faulty = calloc(instance->stats.interface_count, sizeof(uint8_t));
> -	}
> +	instance->stats.interface_count = totem_config->interface_count;
> +	instance->stats.faulty = calloc(instance->stats.interface_count, sizeof(uint8_t));
>  
>  	res = totemrrp_algorithm_set (
>  		instance->totem_config,

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux