浏览代码

audit: fix uninitialized variable in audit_add_rule()

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>
Paul Moore 10 年之前
父节点
当前提交
ae9d2fb482
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kernel/auditfilter.c

+ 1 - 1
kernel/auditfilter.c

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