Skip to content

Commit

Permalink
[PATCH] audit: fix audit_filter_user_rules() initialization bug
Browse files Browse the repository at this point in the history
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 <mingo@elte.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Feb 11, 2007
1 parent ead6596 commit 11f57ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 11f57ce

Please sign in to comment.