diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-07-14 13:55:52 -0400 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-08-08 11:19:41 +0200 |
commit | 84c97cc0b3efd9d521a22d5c1f528902bd670c15 (patch) | |
tree | 807884b6de91965c9b872b9150bfca7bd49f6727 | |
parent | c02c219cd79299a0a153ecf862f0e301a057f2cb (diff) | |
download | seabios-84c97cc0b3efd9d521a22d5c1f528902bd670c15.zip seabios-84c97cc0b3efd9d521a22d5c1f528902bd670c15.tar.gz seabios-84c97cc0b3efd9d521a22d5c1f528902bd670c15.tar.bz2 |
Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.
Make sure the PCI device list is ordered in bus order.
Don't iterate past the end of the list when detecting EHCI devices.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 2a9aeabdfb34374ecac25e7a8d21c9e368618cd4)
-rw-r--r-- | src/pci.c | 1 | ||||
-rw-r--r-- | src/usb.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -122,6 +122,7 @@ pci_probe_devices(void) } memset(dev, 0, sizeof(*dev)); hlist_add(&dev->node, pprev); + pprev = &dev->node.next; count++; // Find parent device. @@ -444,7 +444,7 @@ usb_setup(void) } if (ehcipci->class == PCI_CLASS_SERIAL_USB) found++; - ehcipci = container_of( + ehcipci = container_of_or_null( ehcipci->node.next, struct pci_device, node); if (!ehcipci || (pci_bdf_to_busdev(ehcipci->bdf) != pci_bdf_to_busdev(pci->bdf))) |