diff options
author | Eric Paris <eparis@redhat.com> | 2013-04-16 10:17:02 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-04-16 10:17:02 -0400 |
commit | 34c474de7b4bd451396d67647ac728b0433379a9 (patch) | |
tree | 739ab98b2c0e0fa92f49ba3dee27c15a5915ea9e /kernel/auditsc.c | |
parent | 72199caa8dc7f71d29328069b588340201ee73d7 (diff) |
audit: fix build break when AUDIT_DEBUG == 2
Looks like this one has been around since 5195d8e21:
kernel/auditsc.c: In function ‘audit_free_names’:
kernel/auditsc.c:998: error: ‘i’ undeclared (first use in this function)
...and this warning:
kernel/auditsc.c: In function ‘audit_putname’:
kernel/auditsc.c:2045: warning: ‘i’ may be used uninitialized in this function
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 67df4ee1d3b6..4baf61d39836 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1001,6 +1001,8 @@ static inline void audit_free_names(struct audit_context *context) | |||
1001 | 1001 | ||
1002 | #if AUDIT_DEBUG == 2 | 1002 | #if AUDIT_DEBUG == 2 |
1003 | if (context->put_count + context->ino_count != context->name_count) { | 1003 | if (context->put_count + context->ino_count != context->name_count) { |
1004 | int i = 0; | ||
1005 | |||
1004 | printk(KERN_ERR "%s:%d(:%d): major=%d in_syscall=%d" | 1006 | printk(KERN_ERR "%s:%d(:%d): major=%d in_syscall=%d" |
1005 | " name_count=%d put_count=%d" | 1007 | " name_count=%d put_count=%d" |
1006 | " ino_count=%d [NOT freeing]\n", | 1008 | " ino_count=%d [NOT freeing]\n", |
@@ -1009,7 +1011,7 @@ static inline void audit_free_names(struct audit_context *context) | |||
1009 | context->name_count, context->put_count, | 1011 | context->name_count, context->put_count, |
1010 | context->ino_count); | 1012 | context->ino_count); |
1011 | list_for_each_entry(n, &context->names_list, list) { | 1013 | list_for_each_entry(n, &context->names_list, list) { |
1012 | printk(KERN_ERR "names[%d] = %p = %s\n", i, | 1014 | printk(KERN_ERR "names[%d] = %p = %s\n", i++, |
1013 | n->name, n->name->name ?: "(null)"); | 1015 | n->name, n->name->name ?: "(null)"); |
1014 | } | 1016 | } |
1015 | dump_stack(); | 1017 | dump_stack(); |
@@ -2050,10 +2052,10 @@ void audit_putname(struct filename *name) | |||
2050 | __FILE__, __LINE__, context->serial, name); | 2052 | __FILE__, __LINE__, context->serial, name); |
2051 | if (context->name_count) { | 2053 | if (context->name_count) { |
2052 | struct audit_names *n; | 2054 | struct audit_names *n; |
2053 | int i; | 2055 | int i = 0; |
2054 | 2056 | ||
2055 | list_for_each_entry(n, &context->names_list, list) | 2057 | list_for_each_entry(n, &context->names_list, list) |
2056 | printk(KERN_ERR "name[%d] = %p = %s\n", i, | 2058 | printk(KERN_ERR "name[%d] = %p = %s\n", i++, |
2057 | n->name, n->name->name ?: "(null)"); | 2059 | n->name, n->name->name ?: "(null)"); |
2058 | } | 2060 | } |
2059 | #endif | 2061 | #endif |