Skip to content

Commit

Permalink
selinux: fix error codes in cond_policydb_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and James Morris committed Aug 2, 2010
1 parent fc5c126 commit 38184c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ int evaluate_cond_node(struct policydb *p, struct cond_node *node)

int cond_policydb_init(struct policydb *p)
{
int rc;

p->bool_val_to_struct = NULL;
p->cond_list = NULL;
if (avtab_init(&p->te_cond_avtab))
return -1;

rc = avtab_init(&p->te_cond_avtab);
if (rc)
return rc;

return 0;
}
Expand Down

0 comments on commit 38184c5

Please sign in to comment.