Prev: [PATCH] scripts/kernel-doc: fix fatal error on function prototype
Next: regulator: fix dangling pointers
From: Ben Hutchings on 20 Mar 2010 13:20 This code in agp_amd64_init() can optionally bind to devices generically, and it does this without going through the device core: /* Look for any AGP bridge */ dev = NULL; err = -ENODEV; for_each_pci_dev(dev) { if (!pci_find_capability(dev, PCI_CAP_ID_AGP)) continue; /* Only one bridge supported right now */ if (agp_amd64_probe(dev, NULL) == 0) { err = 0; break; } } This is causing crashes on some systems where sis-agp is already bound to the device. It could even race with binding of another driver when they are both built-in. I think it should be using something like the following instead of directly calling agp_amd64_probe(): down(&dev->dev.sem); if (!dev->dev.driver && driver_probe_device(&drv->driver, &dev->dev) == 0) err = 0; up(&dev->dev.sem); if (err == 0) break; Ben. -- Ben Hutchings Power corrupts. Absolute power is kind of neat. - John Lehman, Secretary of the US Navy 1981-1987 |