diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-09-03 19:35:06 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-09-09 23:48:22 +1000 |
commit | 549077d7d86a1a2b8db4d131b260db9c9e206b66 (patch) | |
tree | 4d7baeefd2e0752e7103a7c2a6794da9f6e1b82e /drivers/crypto | |
parent | 05d2a75441d44a11c6337f5b731fd04d96e1ee9f (diff) | |
download | lwn-549077d7d86a1a2b8db4d131b260db9c9e206b66.tar.gz lwn-549077d7d86a1a2b8db4d131b260db9c9e206b66.zip |
crypto: caam - check irq_of_parse_and_map for errors
Irq_of_parse_and_map will return zero in case of error, so add a error
check for that.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Horia Geantă <horia.geanta@nxp.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/jr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index 7947d61a25cf..2732f3a0725a 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c @@ -537,6 +537,10 @@ static int caam_jr_probe(struct platform_device *pdev) /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); + if (!jrpriv->irq) { + dev_err(jrdev, "irq_of_parse_and_map failed\n"); + return -EINVAL; + } /* Now do the platform independent part */ error = caam_jr_init(jrdev); /* now turn on hardware */ |