mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Luo Yifan <luoyifan@cmss.chinamobile.com>
Cc: jpoimboe@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/lib/subcmd: Move va_end before exit
Date: Mon, 11 Nov 2024 14:43:43 -0300	[thread overview]
Message-ID: <ZzJCT_LkhkKRQOTt@x1> (raw)
In-Reply-To: <20241111091701.275496-1-luoyifan@cmss.chinamobile.com>

On Mon, Nov 11, 2024 at 05:17:01PM +0800, Luo Yifan wrote:
> This patch makes a minor adjustment by moving the va_end call before
> exit. Since the exit() function terminates the program, any code
> after exit(128) (i.e., va_end(params)) is unreachable and thus not
> executed. Placing va_end before exit ensures that the va_list is
> properly cleaned up.

Thanks, applied to perf-tools-next,

- Arnaldo
 
> Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
> ---
>  tools/lib/subcmd/subcmd-util.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
> index dfac76e35..c742b0881 100644
> --- a/tools/lib/subcmd/subcmd-util.h
> +++ b/tools/lib/subcmd/subcmd-util.h
> @@ -20,8 +20,8 @@ static __noreturn inline void die(const char *err, ...)
>  
>  	va_start(params, err);
>  	report(" Fatal: ", err, params);
> -	exit(128);
>  	va_end(params);
> +	exit(128);
>  }
>  
>  #define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
> -- 
> 2.27.0
> 
> 

      reply	other threads:[~2024-11-11 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11  9:17 Luo Yifan
2024-11-11 17:43 ` Arnaldo Carvalho de Melo [this message]

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=ZzJCT_LkhkKRQOTt@x1 \
    --to=acme@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoyifan@cmss.chinamobile.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®