[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130204115601.5569.27640.stgit@zurg>
Date: Mon, 04 Feb 2013 15:56:01 +0400
From: Konstantin Khlebnikov <khlebnikov@...nvz.org>
To: e1000-devel@...ts.sourceforge.net, linux-pci@...r.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
linux-kernel@...r.kernel.org
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Subject: [PATCH v2 3/7] PCI: catch enable-counter underflows
This patch adds single WARN_ONCE() check for catching 'enable_cnt' imbalances.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@...nvz.org>
Cc: linux-pci@...r.kernel.org
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
drivers/pci/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5cb5820..ff93f8f 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1401,6 +1401,9 @@ pci_disable_device(struct pci_dev *dev)
if (dr)
dr->enabled = 0;
+ dev_WARN_ONCE(&dev->dev, atomic_read(&dev->enable_cnt) <= 0,
+ "enable counter underflow");
+
if (atomic_sub_return(1, &dev->enable_cnt) != 0)
return;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists