crypto: caam - pair irq map and dispose in the same function
authorCristian Stoica <cristian.stoica@freescale.com>
Thu, 22 Jan 2015 14:00:48 +0000 (16:00 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 26 Jan 2015 00:34:25 +0000 (11:34 +1100)
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>
drivers/crypto/caam/jr.c

index 9b3ef1bc9bd7846ad26d22ac67156df88ca25243..bce2959993eb9cac7d88bd7fbe4f078237f33f2c 100644 (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);
This page took 0.044108 seconds and 5 git commands to generate.