From: Ingo Molnar Date: Sat, 10 Feb 2007 09:46:09 +0000 (-0800) Subject: [PATCH] audit: fix audit_filter_user_rules() initialization bug X-Git-Tag: v2.6.21-rc1~274^2~278 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=11f57cedcf382574a1e41d6cec2349f287fcea67;p=linux-2.6-omap-h63xx.git [PATCH] audit: fix audit_filter_user_rules() initialization bug gcc emits this warning: kernel/auditfilter.c: In function 'audit_filter_user': kernel/auditfilter.c:1611: warning: 'state' is used uninitialized in this function I tend to agree with gcc - there are a couple of plausible exit paths from audit_filter_user_rules() where it does not set 'state', keeping the variable uninitialized. For example if a filter rule has an AUDIT_POSSIBLE action. Initialize to 'wont audit'. Fix whitespace damage too. Signed-off-by: Ingo Molnar Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 9c8c23227c7..87865f8b4ce 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -1601,8 +1601,8 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb, int audit_filter_user(struct netlink_skb_parms *cb, int type) { + enum audit_state state = AUDIT_DISABLED; struct audit_entry *e; - enum audit_state state; int ret = 1; rcu_read_lock();