提交 c6bf62e4 编写于 作者: C Cristian Stoica 提交者: Herbert Xu

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: NCristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 490f7022
...@@ -384,8 +384,6 @@ static int caam_jr_init(struct device *dev) ...@@ -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) ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册