Commit df0aaa91 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] PCI Hotplug: fix buggy comparison in cpqphp_pci.c

I don't understand the code good enough to be sure my patch is correct,
but the current code is definitely buggy:

0xFF is the maximum value for an u8, so tdevice < 0x100 is _always_
true.
parent 2dddb7cb
......@@ -198,7 +198,7 @@ static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev
ctrl->pci_bus->number = bus_num;
for (tdevice = 0; tdevice < 0x100; tdevice++) {
for (tdevice = 0; tdevice < 0xFF; tdevice++) {
//Scan for access first
if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
continue;
......@@ -210,7 +210,7 @@ static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev
return 0;
}
}
for (tdevice = 0; tdevice < 0x100; tdevice++) {
for (tdevice = 0; tdevice < 0xFF; tdevice++) {
//Scan for access first
if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment