linux-um archives
 help / color / mirror / Atom feed
* [PATCH] um: fix returns without va_end
@ 2015-12-01 20:18 Geyslan G. Bem
  2015-12-08 21:32 ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2015-12-01 20:18 UTC (permalink / raw)
  To: jdike
  Cc: richard, hwhilse, user-mode-linux-devel, user-mode-linux-user,
	linux-kernel, jg.victorino1, peter.senna, Geyslan G. Bem

When using va_list ensure that va_start will be followed by va_end.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 arch/um/drivers/net_user.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index e697a41..e9f8445 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -249,21 +249,23 @@ void close_addr(unsigned char *addr, unsigned char *netmask, void *arg)
 
 char *split_if_spec(char *str, ...)
 {
-	char **arg, *end;
+	char **arg, *end, *ret = NULL;
 	va_list ap;
 
 	va_start(ap, str);
 	while ((arg = va_arg(ap, char **)) != NULL) {
 		if (*str == '\0')
-			return NULL;
+			goto out;
 		end = strchr(str, ',');
 		if (end != str)
 			*arg = str;
 		if (end == NULL)
-			return NULL;
+			goto out;
 		*end++ = '\0';
 		str = end;
 	}
+	ret = str;
+out:
 	va_end(ap);
-	return str;
+	return ret;
 }
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-08 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01 20:18 [PATCH] um: fix returns without va_end Geyslan G. Bem
2015-12-08 21:32 ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox