diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-01-08 16:44:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-08 17:15:21 -0500 |
commit | a0e86bd4252519321b0d102dc4ed90557aa7bee9 (patch) | |
tree | 13c3cb632dfb85ea6b9f5c20273d793a99b20f15 /kernel/audit.c | |
parent | 7dd72f5189b257f927cc3b35d98643a5c392f5c3 (diff) |
audit: always follow va_copy() with va_end()
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 <jj@chaosbits.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 5 |
1 files changed, 3 insertions, 2 deletions
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, | |||
1260 | avail = audit_expand(ab, | 1260 | avail = audit_expand(ab, |
1261 | max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail)); | 1261 | max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail)); |
1262 | if (!avail) | 1262 | if (!avail) |
1263 | goto out; | 1263 | goto out_va_end; |
1264 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2); | 1264 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2); |
1265 | } | 1265 | } |
1266 | va_end(args2); | ||
1267 | if (len > 0) | 1266 | if (len > 0) |
1268 | skb_put(skb, len); | 1267 | skb_put(skb, len); |
1268 | out_va_end: | ||
1269 | va_end(args2); | ||
1269 | out: | 1270 | out: |
1270 | return; | 1271 | return; |
1271 | } | 1272 | } |