mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
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: 60abd3181d
("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>
This commit is contained in:
parent
af15f14c8c
commit
292fed1fc8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user