LKML Archive on
help / color / mirror / Atom feed
From: Ingo Molnar <>
To: Andrew Morton <>
Subject: [patch] audit: fix audit_filter_user_rules() initialization bug
Date: Fri, 12 Jan 2007 13:48:42 +0100	[thread overview]
Message-ID: <> (raw)

From: Ingo Molnar <>
Subject: [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 

Signed-off-by: Ingo Molnar <>

Index: linux/kernel/auditfilter.c
--- linux.orig/kernel/auditfilter.c
+++ linux/kernel/auditfilter.c
@@ -1601,8 +1601,8 @@ static int audit_filter_user_rules(struc
 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;

                 reply	other threads:[~2007-01-12 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: [patch] audit: fix audit_filter_user_rules() initialization bug' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).