summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-01-15 06:10:09 -0500
committerPaul Moore <paul@paul-moore.com>2017-03-29 11:39:17 -0400
commitebd2b47ba52760e9653456ba19032f79d734a343 (patch)
treee76695d8e3a9f72888f9700ca4beb4ec8795f26f /security
parent7befb7514e5d53026e9fe4a6548f118a65a20a4f (diff)
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>
Diffstat (limited to 'security')
-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 5ca2d26ecf7f..658247f98dc1 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -178,10 +178,9 @@ static int roles_init(struct policydb *p)
178 int rc; 178 int rc;
179 struct role_datum *role; 179 struct role_datum *role;
180 180
181 rc = -ENOMEM;
182 role = kzalloc(sizeof(*role), GFP_KERNEL); 181 role = kzalloc(sizeof(*role), GFP_KERNEL);
183 if (!role) 182 if (!role)
184 goto out; 183 return -ENOMEM;
185 184
186 rc = -EINVAL; 185 rc = -EINVAL;
187 role->value = ++p->p_roles.nprim; 186 role->value = ++p->p_roles.nprim;