提交 3ac285ff 编写于 作者: D Davidlohr Bueso 提交者: James Morris

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: NDavidlohr Bueso <dave@gnu.org>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 e5cce6c1
......@@ -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;
}
......
......@@ -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++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册