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>
This commit is contained in:
Cristian Stoica 2015-01-22 16:00:48 +02:00 committed by Herbert Xu
parent 490f702286
commit c6bf62e4f3
1 changed files with 3 additions and 3 deletions

View File

@ -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);