Skip to content

Commit b208332

Browse files
Wei Yongjungregkh
authored andcommitted
selinux: fix error return code in policydb_read()
[ Upstream commit 4c09f8b ] Fix to return negative error code -ENOMEM from the kvcalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: acdf52d ("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>
1 parent 86dced2 commit b208332

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎security/selinux/ss/policydb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,7 @@ int policydb_read(struct policydb *p, void *fp)
24962496
if (rc)
24972497
goto bad;
24982498

2499+
rc = -ENOMEM;
24992500
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
25002501
sizeof(*p->type_attr_map_array),
25012502
GFP_KERNEL);

0 commit comments

Comments
 (0)