[PATCH v2 1/2] spi: geni-qcom: Fix incorrect free_irq() sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In spi_geni_remove(), the IRQ will still remain and it's interrupt handler
may use the dma channel after release dma channel and before free irq,
which is not secure, fix it.

Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma")
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
---
 drivers/spi/spi-geni-qcom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 37ef8c40b276..fc2819effe2d 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1170,9 +1170,10 @@ static void spi_geni_remove(struct platform_device *pdev)
 	/* Unregister _before_ disabling pm_runtime() so we stop transfers */
 	spi_unregister_controller(spi);
 
+	free_irq(mas->irq, spi);
+
 	spi_geni_release_dma_chan(mas);
 
-	free_irq(mas->irq, spi);
 	pm_runtime_disable(&pdev->dev);
 }
 
-- 
2.34.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux