Skip to content

Commit dba89de

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 6a533d6 commit dba89de

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
@@ -2504,6 +2504,7 @@ int policydb_read(struct policydb *p, void *fp)
25042504
if (rc)
25052505
goto bad;
25062506

2507+
rc = -ENOMEM;
25072508
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
25082509
sizeof(*p->type_attr_map_array),
25092510
GFP_KERNEL);

0 commit comments

Comments
 (0)