Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6bf62e4 authored by Cristian Stoica's avatar Cristian Stoica Committed by Herbert Xu
Browse files

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: default avatarCristian Stoica <cristian.stoica@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 490f7022
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);