mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
selinux: fix error return code in policydb_read()
[ Upstream commit4c09f8b691
] Fix to return negative error code -ENOMEM from the kvcalloc() error handling case instead of 0, as done elsewhere in this function. Fixes:acdf52d97f
("selinux: convert to kvmalloc") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
86dced2417
commit
b2083327ea
1 changed files with 1 additions and 0 deletions
|
@ -2496,6 +2496,7 @@ int policydb_read(struct policydb *p, void *fp)
|
||||||
if (rc)
|
if (rc)
|
||||||
goto bad;
|
goto bad;
|
||||||
|
|
||||||
|
rc = -ENOMEM;
|
||||||
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
|
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
|
||||||
sizeof(*p->type_attr_map_array),
|
sizeof(*p->type_attr_map_array),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue