diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2015-12-01 23:18:55 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-12-09 00:26:00 +0300 |
commit | 887a9853092c09e20598f4a7f91ac1cfb762be50 (patch) | |
tree | ddcc50c7a60db81ff7e7c6a48c1328ff54a0548d /arch | |
parent | 8090bfd2bb9abc6293f5cedef8ec9be84a913d2f (diff) | |
download | linux-887a9853092c09e20598f4a7f91ac1cfb762be50.tar.xz |
um: fix returns without va_end
When using va_list ensure that va_start will be followed by va_end.
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/net_user.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index e697a4136707..e9f8445861dc 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; } |