All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 4/4] rtla/osnoise: Fix segmentation fault when failing to enable -t
Date: Fri, 4 Feb 2022 12:44:26 -0500	[thread overview]
Message-ID: <20220204124426.54d82ce2@gandalf.local.home> (raw)
In-Reply-To: <264ff7941b7551ec0b6e5862e40cf3dd593d0ff0.1643990447.git.bristot@kernel.org>

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

  reply	other threads:[~2022-02-04 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 16:24 [PATCH 0/4] Some RTLA fixes Daniel Bristot de Oliveira
2022-02-04 16:24 ` [PATCH 1/4] rtla: Follow kernel version Daniel Bristot de Oliveira
2022-02-04 16:24 ` [PATCH 2/4] rtla/utils: Fix session duration parsing Daniel Bristot de Oliveira
2022-02-04 16:24 ` [PATCH 3/4] rtla/trace: Error message fixup Daniel Bristot de Oliveira
2022-02-04 17:42   ` Steven Rostedt
2022-02-04 16:24 ` [PATCH 4/4] rtla/osnoise: Fix segmentation fault when failing to enable -t Daniel Bristot de Oliveira
2022-02-04 17:44   ` Steven Rostedt [this message]
2022-02-04 17:46     ` Daniel Bristot de Oliveira
2022-02-04 18:15       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220204124426.54d82ce2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.