Skip to content

Commit 4c09f8b

Browse files
Wei Yongjunpcmoore
authored andcommitted
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: acdf52d ("selinux: convert to kvmalloc") Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 9521eb3 commit 4c09f8b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

security/selinux/ss/policydb.c

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

2641+
rc = -ENOMEM;
26412642
p->type_attr_map_array = kvcalloc(p->p_types.nprim,
26422643
sizeof(*p->type_attr_map_array),
26432644
GFP_KERNEL);

0 commit comments

Comments
 (0)