forked from luck/tmp_suning_uos_patched
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: acdf52d97f
("selinux: convert to kvmalloc")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
9521eb3ea1
commit
4c09f8b691
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user