Commit 4c09f8b6 authored by Wei Yongjun's avatar Wei Yongjun Committed by Paul Moore

selinux: fix error return code in policydb_read()

Fix to return negative error code -ENOMEM from the kvcalloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: acdf52d9 ("selinux: convert to kvmalloc")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 9521eb3e
......@@ -2638,6 +2638,7 @@ int policydb_read(struct policydb *p, void *fp)
if (rc)
goto bad;
rc = -ENOMEM;
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
sizeof(*p->type_attr_map_array),
GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment