]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors
authorNicolai Stange <nstange@suse.de>
Mon, 15 Nov 2021 14:18:08 +0000 (15:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:42 +0000 (11:35 +0200)
commitb3b4d6b7abe83be2f6d609942703e6a92afd5286
tree7d1c8649aa2f8c916836055951665e8485a10510
parent0267ae07e6eb746310cf2ff538acf2ccd8bc786e
crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors

[ Upstream commit e9c170444078969c6b74933c1e35aacef739224b ]

Now that drbg_prepare_hrng() doesn't do anything but to instantiate a
jitterentropy crypto_rng instance, it looks a little odd to have the
related error handling at its only caller, drbg_instantiate().

Move the handling of jitterentropy allocation failures from
drbg_instantiate() close to the allocation itself in drbg_prepare_hrng().

There is no change in behaviour.

Signed-off-by: Nicolai Stange <nstange@suse.de>
Reviewed-by: Stephan Müller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: 686cd976b6dd ("crypto: drbg - Only fail when jent is unavailable in FIPS mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/drbg.c