On Mon, 4 Jan 2010 18:25:42 -0700 Matthew Wilcox <matthew@xxxxxx> wrote: > On Mon, Jan 04, 2010 at 03:58:43PM -0800, Yinghai Lu wrote: > > check if dev is null in that function. > > Heh, guess I should have tested in a machine with an empty PCIe slot. > But I don't think this is the right fix. I think we should probably > end up with the code looking like this: > > int pci_scan_slot(struct pci_bus *bus, int devfn) > { > int fn, nr = 0; > struct pci_dev *dev; > > dev = pci_scan_single_device(bus, devfn); > if (!dev) > return 0; > > if (!dev->is_added) > nr++; > > if (pci_ari_enabled(bus)) > next_fn = next_ari_fn; > else if (dev->multifunction) > next_fn = next_trad_fn; > > ... > } > > I'm not in a position to do that this evening; will look at it in the > morning. Any update on this one Yinghai or Matthew? I agree with Matthew's cleanup, the no dev check should probably be in scan_slot rather than each potential callee. -- Jesse Barnes, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html