All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: cb710: drop free_irq for devm_request_irq allocated irq
@ 2013-09-24  2:40 Wei Yongjun
  2013-09-30 13:59 ` Michał Mirosław
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-09-24  2:40 UTC (permalink / raw)
  To: mirq-linux, gregkh; +Cc: yongjun_wei, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

irq allocated with devm_request_irq should not be freed using
free_irq, because doing so causes a dangling pointer, and a
subsequent double free.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/misc/cb710/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
index 2e50f81..fb397e7 100644
--- a/drivers/misc/cb710/core.c
+++ b/drivers/misc/cb710/core.c
@@ -176,7 +176,7 @@ static int cb710_suspend(struct pci_dev *pdev, pm_message_t state)
 {
 	struct cb710_chip *chip = pci_get_drvdata(pdev);
 
-	free_irq(pdev->irq, chip);
+	devm_free_irq(&pdev->dev, pdev->irq, chip);
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
 	if (state.event & PM_EVENT_SLEEP)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: cb710: drop free_irq for devm_request_irq allocated irq
  2013-09-24  2:40 [PATCH] mmc: cb710: drop free_irq for devm_request_irq allocated irq Wei Yongjun
@ 2013-09-30 13:59 ` Michał Mirosław
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Mirosław @ 2013-09-30 13:59 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: gregkh, yongjun_wei, linux-kernel

On Tue, Sep 24, 2013 at 10:40:57AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> irq allocated with devm_request_irq should not be freed using
> free_irq, because doing so causes a dangling pointer, and a
> subsequent double free.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-30 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-24  2:40 [PATCH] mmc: cb710: drop free_irq for devm_request_irq allocated irq Wei Yongjun
2013-09-30 13:59 ` Michał Mirosław

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.