public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edward Shishkin <edward.shishkin@gmail.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] reiserfs: Make sure va_end() is always called after va_start().
Date: Fri, 24 Dec 2010 23:22:11 +0100	[thread overview]
Message-ID: <4D151D13.4060802@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1012241933390.28973@swampdragon.chaosbits.net>

Jesper Juhl wrote:
> Greetings,
>
> A call to va_start() must always be followed by a call to va_end() in the 
> same function. In fs/reiserfs/prints.c::print_block() this is not always 
> the case. If 'bh' is NULL we'll return without calling va_end().
> One could add a call to va_end() before the 'return' statement, but it's 
> nicer to just move the call to va_start() after the test for 'bh' being 
> NULL.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
>   

Acked-by: Edward Shishkin <edward.shishkin@gmail.com>

> ---
>  prints.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
> index adbc6f5..45de98b 100644
> --- a/fs/reiserfs/prints.c
> +++ b/fs/reiserfs/prints.c
> @@ -586,13 +586,13 @@ void print_block(struct buffer_head *bh, ...)	//int print_mode, int first, int l
>  	va_list args;
>  	int mode, first, last;
>  
> -	va_start(args, bh);
> -
>  	if (!bh) {
>  		printk("print_block: buffer is NULL\n");
>  		return;
>  	}
>  
> +	va_start(args, bh);
> +
>  	mode = va_arg(args, int);
>  	first = va_arg(args, int);
>  	last = va_arg(args, int);
>
>
>
>   


      reply	other threads:[~2010-12-24 22:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24 18:37 [PATCH] reiserfs: Make sure va_end() is always called after va_start() Jesper Juhl
2010-12-24 22:22 ` Edward Shishkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D151D13.4060802@gmail.com \
    --to=edward.shishkin@gmail.com \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox