audit: fix uninitialized variable in audit_add_rule()
authorPaul Moore <pmoore@redhat.com>
Wed, 5 Aug 2015 15:19:45 +0000 (11:19 -0400)
committerPaul Moore <pmoore@redhat.com>
Wed, 5 Aug 2015 15:19:45 +0000 (11:19 -0400)
As reported by the 0-Day testing service:

   kernel/auditfilter.c: In function 'audit_rule_change':
>> kernel/auditfilter.c:864:6: warning: 'err' may be used uninit...
     int err;

Cc: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
kernel/auditfilter.c

index 4cb9b44f806e251e23e1c2dd2332237cffe46f8f..83f6d298d2345e6f9dd2890760d6ca0d3cfa3417 100644 (file)
@@ -861,7 +861,7 @@ static inline int audit_add_rule(struct audit_entry *entry)
        struct audit_watch *watch = entry->rule.watch;
        struct audit_tree *tree = entry->rule.tree;
        struct list_head *list;
-       int err;
+       int err = 0;
 #ifdef CONFIG_AUDITSYSCALL
        int dont_count = 0;