From patchwork Tue Jan 28 11:00:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 11354139 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19CEE1398 for ; Tue, 28 Jan 2020 11:43:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02E0724684 for ; Tue, 28 Jan 2020 11:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726063AbgA1LnV (ORCPT ); Tue, 28 Jan 2020 06:43:21 -0500 Received: from viti.kaiser.cx ([85.214.81.225]:39392 "EHLO viti.kaiser.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbgA1LnV (ORCPT ); Tue, 28 Jan 2020 06:43:21 -0500 X-Greylist: delayed 2504 seconds by postgrey-1.27 at vger.kernel.org; Tue, 28 Jan 2020 06:43:20 EST Received: from dslb-088-068-095-017.088.068.pools.vodafone-ip.de ([88.68.95.17] helo=martin-debian-1.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iwOcd-0008Dy-7C; Tue, 28 Jan 2020 12:01:31 +0100 From: Martin Kaiser To: Herbert Xu , PrasannaKumar Muralidharan , NXP Linux Team Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser , stable@vger.kernel.org Subject: [PATCH 1/6] hwrng: imx-rngc - fix an error path Date: Tue, 28 Jan 2020 12:00:57 +0100 Message-Id: <20200128110102.11522-2-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200128110102.11522-1-martin@kaiser.cx> References: <20200128110102.11522-1-martin@kaiser.cx> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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") Signed-off-by: Martin Kaiser Reviewed-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/imx-rngc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c index 30cf00f8e9a0..0576801944fd 100644 --- a/drivers/char/hw_random/imx-rngc.c +++ b/drivers/char/hw_random/imx-rngc.c @@ -105,8 +105,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; }