Skip to content

Commit

Permalink
selinux: fix error return code in cond_read_list()
Browse files Browse the repository at this point in the history
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 <weiyongjun1@huawei.com>
Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
  • Loading branch information
Wei Yongjun authored and Paul Moore committed Apr 27, 2020
1 parent af15f14 commit 292fed1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/selinux/ss/conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ int cond_read_list(struct policydb *p, void *fp)

p->cond_list = kcalloc(len, sizeof(*p->cond_list), GFP_KERNEL);
if (!p->cond_list)
return rc;
return -ENOMEM;

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

0 comments on commit 292fed1

Please sign in to comment.