summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorCristian Stoica <cristian.stoica@freescale.com>2015-01-22 15:00:48 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2015-01-26 01:34:25 +0100
commitc6bf62e4f34f0f490ecbba184e57a8c6808b3cb1 (patch)
treee18131c2d688f526c8d807b08b08b5ba7cce4a6f /drivers/crypto
parentcrypto: ccp - terminate ccp_support array with empty element (diff)
downloadlinux-c6bf62e4f34f0f490ecbba184e57a8c6808b3cb1.tar.xz
linux-c6bf62e4f34f0f490ecbba184e57a8c6808b3cb1.zip
crypto: caam - pair irq map and dispose in the same function
irq_dispose_mapping is not called on all error paths from caam_jr_init. This takes care of several clean-up issues by performing resource clean-up and allocation at the same level. Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/caam/jr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 9b3ef1bc9bd7..bce2959993eb 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -384,8 +384,6 @@ static int caam_jr_init(struct device *dev)
if (error) {
dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
jrp->ridx, jrp->irq);
- irq_dispose_mapping(jrp->irq);
- jrp->irq = 0;
return -EINVAL;
}
@@ -484,8 +482,10 @@ static int caam_jr_probe(struct platform_device *pdev)
/* Now do the platform independent part */
error = caam_jr_init(jrdev); /* now turn on hardware */
- if (error)
+ if (error) {
+ irq_dispose_mapping(jrpriv->irq);
return error;
+ }
jrpriv->dev = jrdev;
spin_lock(&driver_data.jr_alloc_lock);