From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-pci@atrey.karlin.mff.cuni.cz
Cc: linux-kernel@vger.kernel.org, Ben Gardner <gardner.ben@gmail.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 3/5] PCI: Fix pci_find_present
Date: Thu, 31 May 2007 18:16:55 -0700 [thread overview]
Message-ID: <11806606172411-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <11806606172891-git-send-email-gregkh@suse.de>
From: Ben Gardner <gardner.ben@gmail.com>
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>
---
drivers/pci/search.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index b137a27..c132324 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;
}
--
1.5.2
next prev parent reply other threads:[~2007-06-01 1:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-01 1:16 [GIT PATCH] PCI patches for 2.6.22-rc3 Greg KH
2007-06-01 1:16 ` [PATCH 1/5] msi: fix ARM compile Greg Kroah-Hartman
2007-06-01 1:16 ` [PATCH 2/5] PCI: disable MSI by default on systems with Serverworks HT1000 chips Greg Kroah-Hartman
2007-06-01 1:16 ` Greg Kroah-Hartman [this message]
2007-06-01 1:16 ` [PATCH 4/5] PCI: i386: fixup for Siemens Nixdorf AG FSC Multiprocessor Interrupt Controllers Greg Kroah-Hartman
2007-06-01 1:16 ` [PATCH 5/5] PCI: quirk disable MSI on via vt3351 Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11806606172411-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gardner.ben@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox