crypto: caam - free resources in case caam_rng registration failed
authorIuliana Prodan <iuliana.prodan@nxp.com>
Wed, 31 Jul 2019 13:08:12 +0000 (16:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:03 +0000 (14:51 +0100)
commite21a1c26c1bc1b0913541c02b6443cd08f75aaa0
tree215a9fc3705688344901ecf8d04a47cddea54dbc
parent88f089d7f55a0f6d83c0a9032f4069089a73b48e
crypto: caam - free resources in case caam_rng registration failed

[ Upstream commit c59a1d41672a89b5cac49db1a472ff889e35a2d2 ]

Check the return value of the hardware registration for caam_rng and free
resources in case of failure.

Fixes: e24f7c9e87d4 ("crypto: caam - hwrng support")
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/caam/caamrng.c