]> www.infradead.org Git - users/dwmw2/linux.git/commit
selinux: fix error return code in policydb_read()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 29 Apr 2020 07:30:53 +0000 (07:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:37 +0000 (09:32 +0200)
commitdba89dee461f725841c069b577f87825c871bc5b
tree0fe84f399ca5abc503101c9da89f13f86a3eceb8
parent6a533d61853133caf9910a0cecb21a209ea2cdc8
selinux: fix error return code in policydb_read()

[ Upstream commit 4c09f8b6913a779ca0c70ea8058bf21537eebb3b ]

Fix to return negative error code -ENOMEM from the kvcalloc() error
handling case instead of 0, as done elsewhere in this function.

Fixes: acdf52d97f82 ("selinux: convert to kvmalloc")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/selinux/ss/policydb.c