]> git.baikalelectronics.ru Git - kernel.git/commit
hwrng: arm-smccc-trng - fix NO_ENTROPY handling
authorJames Cowgill <james.cowgill@blaize.com>
Mon, 1 Aug 2022 20:04:18 +0000 (20:04 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 19 Aug 2022 10:39:35 +0000 (18:39 +0800)
commit9c7dc11b73a1636b6c1ed0204c11e1c8399ffd8b
tree8d722cdcb291c74c40822f008b6a7ad1de73ba4b
parent9f8bbd1a491f615f9e2168ef9db5a22e8552e269
hwrng: arm-smccc-trng - fix NO_ENTROPY handling

The SMCCC_RET_TRNG_NO_ENTROPY switch arm is never used because the
NO_ENTROPY return value is negative and negative values are handled
above the switch by immediately returning.

Fix by handling errors using a default arm in the switch.

Fixes: 7899017e35a2 ("hwrng: Add Arm SMCCC TRNG based driver")
Signed-off-by: James Cowgill <james.cowgill@blaize.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/arm_smccc_trng.c