l440gx: weird PCI refcounting

Jiri Slaby jirislaby at gmail.com
Wed Jan 13 10:56:45 EST 2010


Hi,

stanse found two PCI device double puts in l440gx code.

init_l440gx looks like:
dev = pci_get_device(PCI_VENDOR_ID_INTEL,...);
pm_dev = pci_get_device(PCI_VENDOR_ID_INTEL,...);

pci_dev_put(dev); // first
...
if (!(pm_iobase->flags & IORESOURCE_IO)) {
  ...
  pci_dev_put(pm_dev); // first
  ...
  if (pci_assign_resource(pm_dev, PIIXE_IOBASE_RESOURCE) != 0) {
    pci_dev_put(dev); // second
    pci_dev_put(pm_dev); // second
    return -ENXIO;
  }
}

I would fix it, but I don't see from that, what the code should do.
pm_dev is used after it's put. And to add, cleanup_l440gx doesn't
contain any puts at all.

Any ideas?

References:
http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=33-rc&id=635#l84
http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=33-rc&id=636#l48

-- 
js



More information about the linux-mtd mailing list