summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2020-03-05 23:58:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 11:45:10 +0300
commitb3e6164647f2c5d3bcb1ca2ee597fce6d81ae39a (patch)
treedaf41828dfe27360553247dcc4948274eab419fb /drivers/char
parent7ab127c8e113345920fe561fef93f82b9122896f (diff)
downloadlinux-b3e6164647f2c5d3bcb1ca2ee597fce6d81ae39a.tar.xz
hwrng: imx-rngc - fix an error path
commit 47a1f8e8b3637ff5f7806587883d7d94068d9ee8 upstream. Make sure that the rngc interrupt is masked if the rngc self test fails. Self test failure means that probe fails as well. Interrupts should be masked in this case, regardless of the error. Cc: stable@vger.kernel.org Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC") Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/imx-rngc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 14730be54edf..dc9b8f377907 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -111,8 +111,10 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
return -ETIMEDOUT;
}
- if (rngc->err_reg != 0)
+ if (rngc->err_reg != 0) {
+ imx_rngc_irq_mask_clear(rngc);
return -EIO;
+ }
return 0;
}