mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sparc: Move va_end() before exit()
@ 2024-12-06  9:23 liujing
  2024-12-06 10:45 ` Andreas Larsson
  2024-12-08 11:03 ` David Laight
  0 siblings, 2 replies; 4+ messages in thread
From: liujing @ 2024-12-06  9:23 UTC (permalink / raw)
  To: davem, andreas; +Cc: sparclinux, linux-kernel, liujing

There is a static checker warning, so move the va_end call before
exit(1). Since the exit(1) 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>
---
V1 -> V2: Modify the commit information and title description

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	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-08 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-06  9:23 [PATCH] sparc: Move va_end() before exit() liujing
2024-12-06 10:45 ` Andreas Larsson
2024-12-08 11:03 ` David Laight
2024-12-08 12:17   ` Thomas Weißschuh

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®