summaryrefslogtreecommitdiffstats
path: root/drivers/pci/search.c
diff options
context:
space:
mode:
authorBen Gardner <gardner.ben@gmail.com>2007-05-11 07:58:58 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2007-06-01 01:56:37 +0200
commit3c92c57af9a24a08b8d2f76650b1209239914fcd (patch)
tree203717bccf072e32dc62db493b0fee6aa4201a44 /drivers/pci/search.c
parentPCI: disable MSI by default on systems with Serverworks HT1000 chips (diff)
downloadlinux-3c92c57af9a24a08b8d2f76650b1209239914fcd.tar.xz
linux-3c92c57af9a24a08b8d2f76650b1209239914fcd.zip
PCI: Fix pci_find_present
pci_find_present() is only matching the last item in the list of ids. The break after the match is found only escapes the for loop, not the while loop, so found gets reset to NULL on the next pass. Signed-off-by: Ben Gardner <gardner.ben@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r--drivers/pci/search.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index b137a27472c7..c13232435dc0 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -403,10 +403,11 @@ const struct pci_device_id *pci_find_present(const struct pci_device_id *ids)
while (ids->vendor || ids->subvendor || ids->class_mask) {
list_for_each_entry(dev, &pci_devices, global_list) {
if ((found = pci_match_one_device(ids, dev)) != NULL)
- break;
+ goto exit;
}
ids++;
}
+exit:
up_read(&pci_bus_sem);
return found;
}