diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-03-09 08:17:32 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-03-09 08:17:32 +0100 |
commit | ce67eef6a112bb283c6db39f9195800f31f5599a (patch) | |
tree | 34f2e7fbd0b9838abba482dbb1a7db09e6fbb53c /arch/x86/pci/mmconfig-shared.c | |
parent | Input: wacom - merge out and in prox events (diff) | |
parent | Linux 2.6.34-rc1 (diff) | |
download | linux-ce67eef6a112bb283c6db39f9195800f31f5599a.tar.xz linux-ce67eef6a112bb283c6db39f9195800f31f5599a.zip |
Merge commit 'v2.6.34-rc1' into for-linus
Diffstat (limited to 'arch/x86/pci/mmconfig-shared.c')
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index b19d1e54201e..8f3f9a50b1e0 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -303,22 +303,17 @@ static void __init pci_mmcfg_check_end_bus_number(void) { struct pci_mmcfg_region *cfg, *cfgx; - /* last one*/ - cfg = list_entry(pci_mmcfg_list.prev, typeof(*cfg), list); - if (cfg) - if (cfg->end_bus < cfg->start_bus) - cfg->end_bus = 255; - - if (list_is_singular(&pci_mmcfg_list)) - return; - - /* don't overlap please */ + /* Fixup overlaps */ list_for_each_entry(cfg, &pci_mmcfg_list, list) { if (cfg->end_bus < cfg->start_bus) cfg->end_bus = 255; + /* Don't access the list head ! */ + if (cfg->list.next == &pci_mmcfg_list) + break; + cfgx = list_entry(cfg->list.next, typeof(*cfg), list); - if (cfg != cfgx && cfg->end_bus >= cfgx->start_bus) + if (cfg->end_bus >= cfgx->start_bus) cfg->end_bus = cfgx->start_bus - 1; } } |