From: Jesper Juhl Date: Thu, 13 Jan 2011 01:00:27 +0000 (-0800) Subject: reiserfs: make sure va_end() is always called after va_start(). X-Git-Tag: Ubuntu-5.2.0-15.16~22558 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=566538a6cf5bec260324dc37b6820dacd8631452;p=mirror_ubuntu-eoan-kernel.git reiserfs: make sure va_end() is always called after va_start(). 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 Acked-by: Edward Shishkin Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c index adbc6f538515..45de98b59466 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);