[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFLxGvxLaMtDhiHgTu8V_QpeUc4DrYd+9TbDT4dbCZj0+x46pw@mail.gmail.com>
Date: Tue, 8 Dec 2015 22:32:41 +0100
From: Richard Weinberger <richard.weinberger@...il.com>
To: "Geyslan G. Bem" <geyslan@...il.com>
Cc: Jeff Dike <jdike@...toit.com>, Richard Weinberger <richard@....at>,
Hans-Werner Hilse <hwhilse@...il.com>,
"user-mode-linux-devel@...ts.sourceforge.net"
<user-mode-linux-devel@...ts.sourceforge.net>,
"user-mode-linux-user@...ts.sourceforge.net"
<user-mode-linux-user@...ts.sourceforge.net>,
LKML <linux-kernel@...r.kernel.org>, jg.victorino1@...il.com,
peter.senna@...il.com
Subject: Re: [PATCH] um: fix returns without va_end
On Tue, Dec 1, 2015 at 9:18 PM, Geyslan G. Bem <geyslan@...il.com> wrote:
> When using va_list ensure that va_start will be followed by va_end.
>
> Signed-off-by: Geyslan G. Bem <geyslan@...il.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;
> }
Applied! :)
--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists