diff options
author | Jesper Juhl <jj@chaosbits.net> | 2011-01-12 20:00:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:15 -0500 |
commit | 566538a6cf5bec260324dc37b6820dacd8631452 (patch) | |
tree | 5f8e0a5821626ce340ed614498a1b8945716848b | |
parent | e0e3d32bb40d28cf57a6a24e1e1d87ef03b913bd (diff) |
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 <jj@chaosbits.net>
Acked-by: Edward Shishkin <edward.shishkin@gmail.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/reiserfs/prints.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
586 | va_list args; | 586 | va_list args; |
587 | int mode, first, last; | 587 | int mode, first, last; |
588 | 588 | ||
589 | va_start(args, bh); | ||
590 | |||
591 | if (!bh) { | 589 | if (!bh) { |
592 | printk("print_block: buffer is NULL\n"); | 590 | printk("print_block: buffer is NULL\n"); |
593 | return; | 591 | return; |
594 | } | 592 | } |
595 | 593 | ||
594 | va_start(args, bh); | ||
595 | |||
596 | mode = va_arg(args, int); | 596 | mode = va_arg(args, int); |
597 | first = va_arg(args, int); | 597 | first = va_arg(args, int); |
598 | last = va_arg(args, int); | 598 | last = va_arg(args, int); |