diff options
Diffstat (limited to 'drivers/crypto/caam/caamhash.c')
-rw-r--r-- | drivers/crypto/caam/caamhash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index e732bd962e9..ca6218eee46 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -1833,6 +1833,13 @@ static int __init caam_algapi_hash_init(void) priv = dev_get_drvdata(ctrldev); of_node_put(dev_node); + /* + * If priv is NULL, it's probably because the caam driver wasn't + * properly initialized (e.g. RNG4 init failed). Thus, bail out here. + */ + if (!priv) + return -ENODEV; + INIT_LIST_HEAD(&priv->hash_list); atomic_set(&priv->tfm_count, -1); |