diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 5cb5820fae40147a29c79913cd1ebadcbfba1348..29a09b705f04e6a7da8069db923cd883599b5e36 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, + "disabling already-disabled device"); + if (atomic_sub_return(1, &dev->enable_cnt) != 0) return;