diff options
author | Cristian Stoica <cristian.stoica@freescale.com> | 2015-01-22 16:00:48 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-01-26 11:34:25 +1100 |
commit | c6bf62e4f34f0f490ecbba184e57a8c6808b3cb1 (patch) | |
tree | e18131c2d688f526c8d807b08b08b5ba7cce4a6f /drivers/crypto/caam | |
parent | 490f702286bc03a2f1538b39c4a19420ce624a73 (diff) | |
download | talos-obmc-linux-c6bf62e4f34f0f490ecbba184e57a8c6808b3cb1.tar.gz talos-obmc-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/caam')
-rw-r--r-- | drivers/crypto/caam/jr.c | 6 |
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); |