* [PATCH] spi: topcliff-pch: Pass correct pointer to free_irq()
@ 2013-05-20 15:54 Lars-Peter Clausen
2013-05-20 16:24 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-05-20 15:54 UTC (permalink / raw)
To: Mark Brown, Grant Likely
Cc: Tomoya MORINAGA, spi-devel-general, linux-kernel,
Lars-Peter Clausen
free_irq() expects the same pointer that was passed to request_irq(), otherwise
the IRQ is not freed.
The issue was found using the following coccinelle script:
<smpl>
@r1@
type T;
T devid;
@@
request_irq(..., devid)
@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)
@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/spi/spi-topcliff-pch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 35f60bd..963e0f3 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1487,7 +1487,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
return 0;
err_spi_register_master:
- free_irq(board_dat->pdev->irq, board_dat);
+ free_irq(board_dat->pdev->irq, data);
err_request_irq:
pch_spi_free_resources(board_dat, data);
err_spi_get_resources:
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: topcliff-pch: Pass correct pointer to free_irq()
2013-05-20 15:54 [PATCH] spi: topcliff-pch: Pass correct pointer to free_irq() Lars-Peter Clausen
@ 2013-05-20 16:24 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-05-20 16:24 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Grant Likely, Tomoya MORINAGA, spi-devel-general, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
On Mon, May 20, 2013 at 05:54:35PM +0200, Lars-Peter Clausen wrote:
> free_irq() expects the same pointer that was passed to request_irq(), otherwise
> the IRQ is not freed.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-20 16:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-20 15:54 [PATCH] spi: topcliff-pch: Pass correct pointer to free_irq() Lars-Peter Clausen
2013-05-20 16:24 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).