* [PATCH] sparc: Move va_end() before exit
@ 2024-12-04 11:21 liujing
2024-12-06 8:19 ` Andreas Larsson
0 siblings, 1 reply; 2+ messages in thread
From: liujing @ 2024-12-04 11:21 UTC (permalink / raw)
To: davem, andreas; +Cc: sparclinux, linux-kernel, liujing
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.
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);
}
/*
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sparc: Move va_end() before exit
2024-12-04 11:21 [PATCH] sparc: Move va_end() before exit liujing
@ 2024-12-06 8:19 ` Andreas Larsson
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Larsson @ 2024-12-06 8:19 UTC (permalink / raw)
To: liujing, davem; +Cc: sparclinux, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-06 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 11:21 [PATCH] sparc: Move va_end() before exit liujing
2024-12-06 8:19 ` Andreas Larsson
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).