diff options
author | Dan Carpenter <error27@gmail.com> | 2010-06-12 14:55:01 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:35:03 -0400 |
commit | 38184c522249dc377366d4edc41dc500c2c3bb9e (patch) | |
tree | 10c87bf5fdaea233a7842a79f04459792e1b5ba1 /security | |
parent | fc5c126e4733e6fb3080d3d822ca63226e74fc84 (diff) |
selinux: fix error codes in cond_policydb_init()
It's better to propagate the error code from avtab_init() instead of
returning -1 (-EPERM). It turns out that avtab_init() never fails so
this patch doesn't change how the code runs but it's still a clean up.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ss/conditional.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index a2b3b298e604..0389263b99ce 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c | |||
@@ -117,10 +117,14 @@ int evaluate_cond_node(struct policydb *p, struct cond_node *node) | |||
117 | 117 | ||
118 | int cond_policydb_init(struct policydb *p) | 118 | int cond_policydb_init(struct policydb *p) |
119 | { | 119 | { |
120 | int rc; | ||
121 | |||
120 | p->bool_val_to_struct = NULL; | 122 | p->bool_val_to_struct = NULL; |
121 | p->cond_list = NULL; | 123 | p->cond_list = NULL; |
122 | if (avtab_init(&p->te_cond_avtab)) | 124 | |
123 | return -1; | 125 | rc = avtab_init(&p->te_cond_avtab); |
126 | if (rc) | ||
127 | return rc; | ||
124 | 128 | ||
125 | return 0; | 129 | return 0; |
126 | } | 130 | } |