mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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>
This commit is contained in:
parent
7befb7514e
commit
ebd2b47ba5
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue