]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SELinux: silence build warning when !CONFIG_BUG
authorEric Paris <eparis@redhat.com>
Wed, 20 Apr 2011 14:21:28 +0000 (10:21 -0400)
committerEric Paris <eparis@redhat.com>
Mon, 25 Apr 2011 14:18:27 +0000 (10:18 -0400)
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>
security/selinux/hooks.c
security/selinux/netnode.c

index d52a9250741231fc1cd7d446681d5309654d0ce1..7a630a8a5cef1c833b0204e463d6c7e3c4cdbe9d 100644 (file)
@@ -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);
index 65ebfe954f85395f490ce74d694d73a859b523ac..3618251d0fdb4435dfb96be2c845c0727deca04d 100644 (file)
@@ -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)