summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/policydb.c
diff options
context:
space:
mode:
authorMarkus Elfring2017-01-15 12:10:09 +0100
committerPaul Moore2017-03-29 17:39:17 +0200
commitebd2b47ba52760e9653456ba19032f79d734a343 (patch)
treee76695d8e3a9f72888f9700ca4beb4ec8795f26f /security/selinux/ss/policydb.c
parentselinux: Return directly after a failed kzalloc() in perm_read() (diff)
downloadkernel-qcow2-linux-ebd2b47ba52760e9653456ba19032f79d734a343.tar.gz
kernel-qcow2-linux-ebd2b47ba52760e9653456ba19032f79d734a343.tar.xz
kernel-qcow2-linux-ebd2b47ba52760e9653456ba19032f79d734a343.zip
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/selinux/ss/policydb.c')
-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)
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;