sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas@gaisler.com>
To: liujing <liujing@cmss.chinamobile.com>, davem@davemloft.net
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sparc: Move va_end() before exit
Date: Fri, 6 Dec 2024 09:19:49 +0100	[thread overview]
Message-ID: <6bc7817c-6044-4999-b901-1b87e88fef42@gaisler.com> (raw)
In-Reply-To: <20241204112145.6987-1-liujing@cmss.chinamobile.com>

On 2024-12-04 12:21, liujing wrote:
> [PATCH] sparc: Move va_end() before exit

Please use exit() rather than exit also here. As it is the calls you are
swapping order of and not an implementation perhaps phrase it "Call
va_end()..." or "Move va_end() call..." or something like that. Please
also indicate where this change is happening, not just in sparc.

> 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(1) is unreachable thus notexecuted. Placing va_end before
> exit ensures that the va_list is properly cleaned up.

Please also describe how you found this.

> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
> 
> diff --git a/arch/sparc/vdso/vdso2c.c b/arch/sparc/vdso/vdso2c.c
> index dc81240aab6f..372e3330850a 100644
> --- a/arch/sparc/vdso/vdso2c.c
> +++ b/arch/sparc/vdso/vdso2c.c
> @@ -90,8 +90,8 @@ static void fail(const char *format, ...)
>  	vfprintf(stderr, format, ap);
>  	if (outfilename)
>  		unlink(outfilename);
> -	exit(1);
>  	va_end(ap);
> +	exit(1);
>  }
>  
>  /*

Cheers,
Andreas

      reply	other threads:[~2024-12-06  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 11:21 [PATCH] sparc: Move va_end() before exit liujing
2024-12-06  8:19 ` Andreas Larsson [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=6bc7817c-6044-4999-b901-1b87e88fef42@gaisler.com \
    --to=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liujing@cmss.chinamobile.com \
    --cc=sparclinux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).