l440gx: weird PCI refcounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
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

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux