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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:24 +0000 (12:35 +0200)
commit8ffe511b7de72712e7210894e9e71d184a43d33c
treebb02d1e40afc0b3324dd409b6759bccaa2100a7d
parent272093471305261c4e07a2fc97c2d1e53cd56819
hwrng: arm-smccc-trng - fix NO_ENTROPY handling

[ Upstream commit 042b4b169c6fb9d4df268d66282d7302dd73d37b ]

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: 0888d04b47a1 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/hw_random/arm_smccc_trng.c