public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 5/7] selinux: fix error codes in cond_policydb_init()
@ 2010-06-07 21:08 Dan Carpenter
  2010-06-08 20:20 ` Eric Paris
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-06-07 21:08 UTC (permalink / raw)
  To: kernel-janitors

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>

diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index f0de637..7447be0 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)
 
 int cond_policydb_init(struct policydb *p)
 {
+	int ret;
+
 	p->bool_val_to_struct = NULL;
 	p->cond_list = NULL;
-	if (avtab_init(&p->te_cond_avtab))
-		return -1;
+
+	ret = avtab_init(&p->te_cond_avtab);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-08 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07 21:08 [patch 5/7] selinux: fix error codes in cond_policydb_init() Dan Carpenter
2010-06-08 20:20 ` Eric Paris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox