Skip to content

Commit 292fed1

Browse files
Wei Yongjunpcmoore
authored andcommitted
selinux: fix error return code in cond_read_list()
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 60abd31 ("selinux: convert cond_list to array") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Ondrej Mosnacek <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent af15f14 commit 292fed1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/selinux/ss/conditional.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ int cond_read_list(struct policydb *p, void *fp)
429429

430430
p->cond_list = kcalloc(len, sizeof(*p->cond_list), GFP_KERNEL);
431431
if (!p->cond_list)
432-
return rc;
432+
return -ENOMEM;
433433

434434
rc = avtab_alloc(&(p->te_cond_avtab), p->te_avtab.nel);
435435
if (rc)

0 commit comments

Comments
 (0)