public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reiserfs: Make sure va_end() is always called after va_start().
@ 2010-12-24 18:37 Jesper Juhl
  2010-12-24 22:22 ` Edward Shishkin
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2010-12-24 18:37 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: linux-kernel

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>
---
 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);



-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-24 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox