summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-27 14:49:35 +0200
committerPaul Moore <paul@paul-moore.com>2020-04-27 23:44:39 +0200
commit292fed1fc89509bab2c0b291d5d395dea5b6ab2f (patch)
tree36a10d1d1f71e4b47e6055b01650e67ee86023a3 /security/selinux/ss
parentselinux: free str on error in str_read() (diff)
downloadlinux-292fed1fc89509bab2c0b291d5d395dea5b6ab2f.tar.xz
linux-292fed1fc89509bab2c0b291d5d395dea5b6ab2f.zip
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: 60abd3181db2 ("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>
Diffstat (limited to 'security/selinux/ss')
-rw-r--r--security/selinux/ss/conditional.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 939a74fd8fb4..da94a1b4bfda 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -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)