mmc: cb710: drop free_irq for devm_request_irq allocated irq
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 24 Sep 2013 02:40:57 +0000 (10:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 20:55:30 +0000 (13:55 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cb710/core.c

index 2e50f811ff599205aade6f1b877bc7877e3917bb..fb397e7d1cce8a17ab2583c2bedc49438d72b03b 100644 (file)
@@ -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)