diff options
author | Cristian Stoica <cristian.stoica@freescale.com> | 2015-01-22 09:00:48 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-01-25 19:34:25 -0500 |
commit | c6bf62e4f34f0f490ecbba184e57a8c6808b3cb1 (patch) | |
tree | e18131c2d688f526c8d807b08b08b5ba7cce4a6f | |
parent | 490f702286bc03a2f1538b39c4a19420ce624a73 (diff) |
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>
-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) | |||
384 | if (error) { | 384 | if (error) { |
385 | dev_err(dev, "can't connect JobR %d interrupt (%d)\n", | 385 | dev_err(dev, "can't connect JobR %d interrupt (%d)\n", |
386 | jrp->ridx, jrp->irq); | 386 | jrp->ridx, jrp->irq); |
387 | irq_dispose_mapping(jrp->irq); | ||
388 | jrp->irq = 0; | ||
389 | return -EINVAL; | 387 | return -EINVAL; |
390 | } | 388 | } |
391 | 389 | ||
@@ -484,8 +482,10 @@ static int caam_jr_probe(struct platform_device *pdev) | |||
484 | 482 | ||
485 | /* Now do the platform independent part */ | 483 | /* Now do the platform independent part */ |
486 | error = caam_jr_init(jrdev); /* now turn on hardware */ | 484 | error = caam_jr_init(jrdev); /* now turn on hardware */ |
487 | if (error) | 485 | if (error) { |
486 | irq_dispose_mapping(jrpriv->irq); | ||
488 | return error; | 487 | return error; |
488 | } | ||
489 | 489 | ||
490 | jrpriv->dev = jrdev; | 490 | jrpriv->dev = jrdev; |
491 | spin_lock(&driver_data.jr_alloc_lock); | 491 | spin_lock(&driver_data.jr_alloc_lock); |