Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Paul Moore
292fed1f af15f14c

+1 -1
+1 -1
security/selinux/ss/conditional.c
··· 429 429 430 430 p->cond_list = kcalloc(len, sizeof(*p->cond_list), GFP_KERNEL); 431 431 if (!p->cond_list) 432 - return rc; 432 + return -ENOMEM; 433 433 434 434 rc = avtab_alloc(&(p->te_cond_avtab), p->te_avtab.nel); 435 435 if (rc)