Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebd2b47b authored by Markus Elfring's avatar Markus Elfring Committed by Paul Moore
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 7befb751
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;