summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-15 12:10:09 +0100
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:39:17 -0400
commitebd2b47ba52760e9653456ba19032f79d734a343 (patch)
treee76695d8e3a9f72888f9700ca4beb4ec8795f26f
parent7befb7514e5d53026e9fe4a6548f118a65a20a4f (diff)
downloadop-kernel-dev-ebd2b47ba52760e9653456ba19032f79d734a343.zip
op-kernel-dev-ebd2b47ba52760e9653456ba19032f79d734a343.tar.gz
selinux: Return directly after a failed kzalloc() in roles_init()
Return directly after a call of the function "kzalloc" failed at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--security/selinux/ss/policydb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 5ca2d26e..658247f 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -178,10 +178,9 @@ static int roles_init(struct policydb *p)
int rc;
struct role_datum *role;
- rc = -ENOMEM;
role = kzalloc(sizeof(*role), GFP_KERNEL);
if (!role)
- goto out;
+ return -ENOMEM;
rc = -EINVAL;
role->value = ++p->p_roles.nprim;
OpenPOWER on IntegriCloud