Skip to content

Commit

Permalink
SELinux: silence build warning when !CONFIG_BUG
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Paris committed Apr 25, 2011
1 parent 425b473 commit a35c6c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, ',');
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions security/selinux/netnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ static struct sel_netnode *sel_netnode_find(const void *addr, u16 family)
break;
default:
BUG();
return NULL;
}

list_for_each_entry_rcu(node, &sel_netnode_hash[idx].list, list)
Expand Down

0 comments on commit a35c6c8

Please sign in to comment.