提交 38184c52 编写于 作者: D Dan Carpenter 提交者: James Morris

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: NDan Carpenter <error27@gmail.com>
Acked-by: NStephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 fc5c126e
...@@ -117,10 +117,14 @@ int evaluate_cond_node(struct policydb *p, struct cond_node *node) ...@@ -117,10 +117,14 @@ int evaluate_cond_node(struct policydb *p, struct cond_node *node)
int cond_policydb_init(struct policydb *p) int cond_policydb_init(struct policydb *p)
{ {
int rc;
p->bool_val_to_struct = NULL; p->bool_val_to_struct = NULL;
p->cond_list = 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; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册