From: Jesper Juhl Date: Wed, 3 Aug 2011 00:52:38 +0000 (+1000) Subject: A call to va_copy() should always be followed by a call to va_end() in the X-Git-Tag: next-20110804~2^2~89 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69fc9acdebe2eb6b68b2453f8c1cdf2d621d2b33;p=karo-tx-linux.git A call to va_copy() should always be followed by a call to va_end() in the 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 Cc: Al Viro Cc: Eric Paris Signed-off-by: Andrew Morton --- diff --git a/kernel/audit.c b/kernel/audit.c index 09fae2677a45..2c1d6ab7106e 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -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; }