Skip to contentSkip to conversation

crypto: cesa: add missing free_irq() calls

PATCH In review Rosen Penev 2 participants 2 messages Jun 28 – Jul 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: cesa: add missing free_irq() calls

Add the missing free_irq() calls, along with irq_set_affinity_hint(NULL) to clear the affinity hint set during probe.

Fixes 5bbf25419f8e ("crypto: marvell/cesa - use request_threaded_irq instead of devm variant")
Assisted-by opencode:big-pickle
---
 drivers/crypto/marvell/cesa/cesa.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/crypto/marvell/cesa/cesa.c +11 -2
index 75d8ba23d9a2..57c9295be711 100644
@@ -511,7 +511,7 @@ static int mv_cesa_probe(struct platform_device *pdev)
 		writel(engine->sram_dma & CESA_SA_SRAM_MSK,
 		       engine->regs + CESA_SA_DESC_P0);
 
-		ret = devm_request_threaded_irq(dev, irq, NULL, mv_cesa_int,
+		ret = request_threaded_irq(irq, NULL, mv_cesa_int,
 						IRQF_ONESHOT,
 						dev_name(&pdev->dev),
 						engine);
@@ -540,6 +540,10 @@ static int mv_cesa_probe(struct platform_device *pdev)
 	return 0;
 
 err_cleanup:
+	while (i--) {
+		irq_set_affinity_hint(cesa->engines[i].irq, NULL);
+		free_irq(cesa->engines[i].irq, &cesa->engines[i]);
+	}
 	for (i = 0; i < caps->nengines; i++)
 		mv_cesa_put_sram(pdev, i);
 
@@ -553,8 +557,13 @@ static void mv_cesa_remove(struct platform_device *pdev)
 
 	mv_cesa_remove_algs(cesa);
 
-	for (i = 0; i < cesa->caps->nengines; i++)
+	for (i = 0; i < cesa->caps->nengines; i++) {
+		struct mv_cesa_engine *engine = &cesa->engines[i];
+
+		irq_set_affinity_hint(engine->irq, NULL);
+		free_irq(engine->irq, engine);
 		mv_cesa_put_sram(pdev, i);
+	}
 }
 
 static const struct platform_device_id mv_cesa_plat_id_table[] = {
Signature · 1 line
2.54.0
maintainer
#1 lore raw
Quoted 4 lines · Rosen Penev

Add the missing free_irq() calls, along with irq_set_affinity_hint(NULL) to clear the affinity hint set during probe.

Fixes 5bbf25419f8e ("crypto: marvell/cesa - use request_threaded_irq instead of devm variant")

This commit does not exist.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt