Re: [PATCH] trace: don't use uninited max_tr_ring_buffer

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

 



Hi Rabin,

The patch looks fine to me -- forwarding to the trace.c maintainer Jie Fei
directly for his ACK.

Thanks,
  Dave
  
----- Original Message -----
> From: Rabin Vincent <rabinv@xxxxxxxx>
> 
> This max buffer is not available in all configurations of the kernel so
> we shouldn't attempt to use the unitialized max_tr_ring_buffer variable.
> A similar check existed previously before the recent rework of the trace
> extension to support multiple buffers.
> ---
>  extensions/trace.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/extensions/trace.c b/extensions/trace.c
> index 51df98d..22039a9 100644
> --- a/extensions/trace.c
> +++ b/extensions/trace.c
> @@ -487,6 +487,9 @@ static int ftrace_init_trace(struct trace_instance *ti,
> ulong instance_addr)
>  			ti->pages) < 0)
>  		goto out_fail;
>  
> +	if (!ti->max_tr_ring_buffer)
> +		return 0;
> +
>  	ti->max_tr_buffers = calloc(sizeof(*ti->max_tr_buffers), nr_cpu_ids);
>  	if (ti->max_tr_buffers == NULL)
>  		goto out_fail;
> --
> 2.1.4
> 
> --
> Crash-utility mailing list
> Crash-utility@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/crash-utility
> 

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility



[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux