crypto: drbg - fix error return code in drbg_alloc_state()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 30 Apr 2020 08:13:53 +0000 (08:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:42:00 +0000 (16:42 +0200)
commit736809aeb500ba4bc68c3b4e8ffb49810d7266ad
tree9875ec8ec3e57f0d24e9f1df5853f3e7fe39a31e
parent12eb70506a22ee23032ae18e90ffea0fc0075c68
crypto: drbg - fix error return code in drbg_alloc_state()

commit e0664ebcea6ac5e16da703409fb4bd61f8cd37d9 upstream.

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

Reported-by: Xiumei Mu <xmu@redhat.com>
Fixes: db07cd26ac6a ("crypto: drbg - add FIPS 140-2 CTRNG for noise source")
Cc: <stable@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/drbg.c