]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
A call to va_copy() should always be followed by a call to va_end() in the
authorJesper Juhl <jj@chaosbits.net>
Sat, 16 Jul 2011 13:30:54 +0000 (23:30 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 26 Jul 2011 05:04:57 +0000 (15:04 +1000)
same function.  In kernel/autit.c::audit_log_vformat() this is not always
done.  This patch makes sure va_end() is always called.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/audit.c

index 52501b5d4902b5842f81c83e78b7e6b46652b314..2c7bb909bc0acea928dd8c2153ec296d7a390be1 100644 (file)
@@ -1260,12 +1260,13 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
                avail = audit_expand(ab,
                        max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail));
                if (!avail)
-                       goto out;
+                       goto out_va_end;
                len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
        }
-       va_end(args2);
        if (len > 0)
                skb_put(skb, len);
+out_va_end:
+       va_end(args2);
 out:
        return;
 }