OSDN Git Service

hwrng: ingenic - Fix a resource leak in an error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 19 Dec 2020 07:52:07 +0000 (08:52 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 2 Jan 2021 21:41:37 +0000 (08:41 +1100)
commitc4ff41b93d1f10d1b8be258c31a0436c5769fc00
treec68dfb2d9fefacfd7c7265b229c47ee075170c6c
parent256693a36203f51b0a3659c8b215a7026a03a3f1
hwrng: ingenic - Fix a resource leak in an error handling path

In case of error, we should call 'clk_disable_unprepare()' to undo a
previous 'clk_prepare_enable()' call, as already done in the remove
function.

Fixes: 406346d22278 ("hwrng: ingenic - Add hardware TRNG for Ingenic X1830")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/ingenic-trng.c