On Wed, Mar 26, 2008 at 01:46:33PM -0700, Linus Torvalds wrote:Indeed. This should prevent an oops in all cases. Ivan. --- PCI: improved sanity check for pdev_sort_resources() Prevent potential oops with unsized PCI bridge resources. Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> --- drivers/pci/setup-res.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 4be7ccf..fb57c8b 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -226,18 +226,17 @@ void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) if (r->flags & IORESOURCE_PCI_FIXED) continue; - r_align = r->end - r->start; - + r_align = (i < PCI_BRIDGE_RESOURCES) ? r->end - r->start + 1 : + r->start; if (!(r->flags) || r->parent) continue; - if (!r_align) { + if (r_align <= 1) { printk(KERN_WARNING "PCI: Ignore bogus resource %d " "[%llx:%llx] of %s\n", i, (unsigned long long)r->start, (unsigned long long)r->end, pci_name(dev)); continue; } - r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start; for (list = head; ; list = list->next) { resource_size_t align = 0; struct resource_list *ln = list->next; --
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Tejun Heo | [PATCHSET] FUSE: extend FUSE to support more operations |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Linus Torvalds | Linux 2.6.27 |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| Jari Aalto | Re: On Tabs and Spaces |
| Felipe Balbi | Re: git-svnimport |
| Jakub Narebski | Re: VCS comparison table |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Kevin Neff | Patching a SSH 'Weakness' |
| F. Caulier | [Perl/locales] Warning about locales |
| OBSD | KSH and Bash problem with long commands |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Chris Snook | [RFC] introducing the Atheros L2 Fast Ethernet driver |
| Tilman Schmidt | Re: 2.6.25-rc8: FTP transfer errors |
| Treason Uncloaked | 1 hour ago | Linux kernel |
| Shared swap partition | 12 hours ago | Linux general |
| high memory | 2 days ago | Linux kernel |
| semaphore access speed | 2 days ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
