summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/ctrl.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-26 15:39:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-26 15:39:01 +0100
commit134d1fd44221614d7de994d07ef92a6111952e1c (patch)
tree5d6e5db31b5a9d2483388624820e6ca053d87cfa /drivers/crypto/caam/ctrl.c
parentUSB: chaoskey: Use kasprintf() over strcpy()/strcat() (diff)
parentLinux 4.16-rc3 (diff)
downloadlinux-134d1fd44221614d7de994d07ef92a6111952e1c.tar.xz
linux-134d1fd44221614d7de994d07ef92a6111952e1c.zip
Merge 4.16-rc3 into usb-next
We want the USB fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto/caam/ctrl.c')
-rw-r--r--drivers/crypto/caam/ctrl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 75d280cb2dc0..e843cf410373 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -228,12 +228,16 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask,
* without any error (HW optimizations for later
* CAAM eras), then try again.
*/
+ if (ret)
+ break;
+
rdsta_val = rd_reg32(&ctrl->r4tst[0].rdsta) & RDSTA_IFMASK;
if ((status && status != JRSTA_SSRC_JUMP_HALT_CC) ||
- !(rdsta_val & (1 << sh_idx)))
+ !(rdsta_val & (1 << sh_idx))) {
ret = -EAGAIN;
- if (ret)
break;
+ }
+
dev_info(ctrldev, "Instantiated RNG4 SH%d\n", sh_idx);
/* Clear the contents before recreating the descriptor */
memset(desc, 0x00, CAAM_CMD_SZ * 7);