summaryrefslogtreecommitdiff
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2011-04-20 10:21:28 -0400
committerEric Paris <eparis@redhat.com>2011-04-25 10:18:27 -0400
commita35c6c8368d88deae6890205e73ed330b6df1db7 (patch)
treef61c3da7460bb5ab39353404456d92e005e9000e /security/selinux/hooks.c
parent425b473de5372cad6fffc6b98a758ed8e3fc70ce (diff)
SELinux: silence build warning when !CONFIG_BUG
If one builds a kernel without CONFIG_BUG there are a number of 'may be used uninitialized' warnings. Silence these by returning after the BUG(). Signed-off-by: Eric Paris <eparis@redhat.com> Reviewed-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index d52a9250741..7a630a8a5ce 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -989,6 +989,7 @@ static void selinux_write_opts(struct seq_file *m,
continue;
default:
BUG();
+ return;
};
/* we need a comma before each option */
seq_putc(m, ',');
@@ -1442,6 +1443,7 @@ static int task_has_capability(struct task_struct *tsk,
printk(KERN_ERR
"SELinux: out of range capability %d\n", cap);
BUG();
+ return -EINVAL;
}
rc = avc_has_perm_noaudit(sid, sid, sclass, av, 0, &avd);