[PATCH] PCI: Fix missing update in pci_slot_unlock() after locking changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The cited patch updated pci_slot_lock(), pci_slot_trylock(),
pci_bus_lock(), and pci_bus_trylock() recursive locking, and adjusted
pci_bus_unlock() accordingly. However, it missed updating
pci_slot_unlock(), which may lead to attempting to unlock the
subordinate bridge's device lock twice.

Fixes: a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()")
Signed-off-by: Moshe Shemesh <moshe@xxxxxxxxxx>
---
 drivers/pci/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4d7c9f64ea24..26507aa906d7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5542,7 +5542,8 @@ static void pci_slot_unlock(struct pci_slot *slot)
 			continue;
 		if (dev->subordinate)
 			pci_bus_unlock(dev->subordinate);
-		pci_dev_unlock(dev);
+		else
+			pci_dev_unlock(dev);
 	}
 }
 
-- 
2.18.2





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux