From: Markus Elfring Date: Sun, 15 Jan 2017 11:10:09 +0000 (+0100) Subject: selinux: Return directly after a failed kzalloc() in roles_init() X-Git-Tag: v4.12-rc1~123^2~6^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ebd2b47ba52760e9653456ba19032f79d734a343;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Paul Moore --- diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 5ca2d26ecf7fe..658247f98dc13 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;