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

Commit 3ac285ff authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by James Morris
Browse files

selinux: return -ENOMEM when memory allocation fails



Return -ENOMEM when memory allocation fails in cond_init_bool_indexes,
correctly propagating error code to caller.

Signed-off-by: default avatarDavidlohr Bueso <dave@gnu.org>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent e5cce6c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ int cond_init_bool_indexes(struct policydb *p)
	p->bool_val_to_struct = (struct cond_bool_datum **)
		kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum *), GFP_KERNEL);
	if (!p->bool_val_to_struct)
		return -1;
		return -ENOMEM;
	return 0;
}

+2 −2
Original line number Diff line number Diff line
@@ -501,8 +501,8 @@ static int policydb_index(struct policydb *p)
	if (rc)
		goto out;

	rc = -ENOMEM;
	if (cond_init_bool_indexes(p))
	rc = cond_init_bool_indexes(p);
	if (rc)
		goto out;

	for (i = 0; i < SYM_NUM; i++) {