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:
parent
490f702286
commit
c6bf62e4f3
|
@ -384,8 +384,6 @@ static int caam_jr_init(struct device *dev)
|
||||||
if (error) {
|
if (error) {
|
||||||
dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
|
dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
|
||||||
jrp->ridx, jrp->irq);
|
jrp->ridx, jrp->irq);
|
||||||
irq_dispose_mapping(jrp->irq);
|
|
||||||
jrp->irq = 0;
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,8 +482,10 @@ static int caam_jr_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* Now do the platform independent part */
|
/* Now do the platform independent part */
|
||||||
error = caam_jr_init(jrdev); /* now turn on hardware */
|
error = caam_jr_init(jrdev); /* now turn on hardware */
|
||||||
if (error)
|
if (error) {
|
||||||
|
irq_dispose_mapping(jrpriv->irq);
|
||||||
return error;
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
jrpriv->dev = jrdev;
|
jrpriv->dev = jrdev;
|
||||||
spin_lock(&driver_data.jr_alloc_lock);
|
spin_lock(&driver_data.jr_alloc_lock);
|
||||||
|
|
Loading…
Reference in New Issue