From: Alan Stern Date: Thu, 23 Feb 2006 22:12:51 +0000 (-0500) Subject: [PATCH] PCI: Move pci_dev_put outside a spinlock X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b89b7ea05a8f71426bd36ed12e6cd73179d0f720;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] PCI: Move pci_dev_put outside a spinlock This patch (as659) fixes a might_sleep problem in the PCI core, by moving a call to pci_dev_put() outside the scope of a spinlock. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 05fa91a31c62..ce7dd6e7be60 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -246,9 +246,9 @@ pci_get_subsys(unsigned int vendor, unsigned int device, } dev = NULL; exit: - pci_dev_put(from); dev = pci_dev_get(dev); spin_unlock(&pci_bus_lock); + pci_dev_put(from); return dev; } @@ -339,9 +339,9 @@ struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from) } dev = NULL; exit: - pci_dev_put(from); dev = pci_dev_get(dev); spin_unlock(&pci_bus_lock); + pci_dev_put(from); return dev; }