[ltt-dev] [PATCH] ltt-ascii: Fix buggy error handling

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue May 11 07:38:00 EDT 2010


* Balaji Rao (balajirrao at gmail.com) wrote:
> Hi Mathieu,
> 
> Fix ltt_relay_iter_open_channel to cleanup correctly on error.

Merged, thanks!

Sorry for the delay.

Mathieu

> 
> Thanks,
> Balaji
> 
> --
> Signed-off-by: Balaji Rao <balaji at raobalaji.com>
> 
> diff --git a/ltt/ltt-ascii.c b/ltt/ltt-ascii.c
> index eeb7033..08925ea 100644
> --- a/ltt/ltt-ascii.c
> +++ b/ltt/ltt-ascii.c
> @@ -423,8 +423,11 @@ static int ltt_relay_iter_open_channel(struct ltt_relay_iter *iter,
>  		}
>  		update_cpu_iter(citer, citer->hdr_offset);
>  	}
> -	if (!iter->nr_refs)
> -		return -ENODATA; /* no data available */
> +	if (!iter->nr_refs) {
> +		ret = -ENODATA;
> +		goto error;
> +	}
> +
>  	return 0;
>  
>  error:
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list