diff options
author | Geyslan G. Bem <geyslan@gmail.com> | 2015-12-01 21:18:55 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-12-08 22:26:00 +0100 |
commit | 887a9853092c09e20598f4a7f91ac1cfb762be50 (patch) | |
tree | ddcc50c7a60db81ff7e7c6a48c1328ff54a0548d /arch/um | |
parent | um: Fix fpstate handling (diff) | |
download | linux-887a9853092c09e20598f4a7f91ac1cfb762be50.tar.xz linux-887a9853092c09e20598f4a7f91ac1cfb762be50.zip |
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/um')
-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; } |