lkml.org 
[lkml]   [2022]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] rtla/osnoise: Fix segmentation fault when failing to enable -t
On Fri,  4 Feb 2022 17:24:05 +0100
Daniel Bristot de Oliveira <bristot@kernel.org> wrote:

> --- a/tools/tracing/rtla/src/osnoise.c
> +++ b/tools/tracing/rtla/src/osnoise.c
> @@ -750,6 +750,9 @@ void osnoise_put_context(struct osnoise_context *context)
> */
> void osnoise_destroy_tool(struct osnoise_tool *top)
> {
> + if (!top)
> + return;
> +
> trace_instance_destroy(&top->trace);
>
> if (top->context)

Um, don't you still need to initialize everything to NULL?

i.e.

nt osnoise_top_main(int argc, char **argv)
{
struct osnoise_top_params *params;
struct trace_instance *trace;
struct osnoise_tool *record;
struct osnoise_tool *tool;
int return_value = 1;
int retval;



Does not guarantee that record and tool will be initialized to NULL.

-- Steve

\
 
 \ /
  Last update: 2022-02-04 18:45    [W:0.070 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site