Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750906AbbLHVcm (ORCPT ); Tue, 8 Dec 2015 16:32:42 -0500 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35875 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbbLHVcm (ORCPT ); Tue, 8 Dec 2015 16:32:42 -0500 MIME-Version: 1.0 In-Reply-To: <1449001135-29980-1-git-send-email-geyslan@gmail.com> References: <1449001135-29980-1-git-send-email-geyslan@gmail.com> Date: Tue, 8 Dec 2015 22:32:41 +0100 Message-ID: Subject: Re: [PATCH] um: fix returns without va_end From: Richard Weinberger To: "Geyslan G. Bem" Cc: Jeff Dike , Richard Weinberger , Hans-Werner Hilse , "user-mode-linux-devel@lists.sourceforge.net" , "user-mode-linux-user@lists.sourceforge.net" , LKML , jg.victorino1@gmail.com, peter.senna@gmail.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 51 On Tue, Dec 1, 2015 at 9:18 PM, Geyslan G. Bem wrote: > When using va_list ensure that va_start will be followed by va_end. > > Signed-off-by: Geyslan G. Bem > --- > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/