User: | Jiri Slaby |
Error type: | Resource Leak |
Error type description: | The code omits to put the resource to the system for reuse |
File location: | drivers/pci/search.c |
Line in file: | 169 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2011-11-07 22:40:13 UTC |
139 pci_dev_put(dev); 140 return dev; 141 } 142 } 143 return NULL; 144} 145EXPORT_SYMBOL(pci_find_slot); 146 147/** 148 * pci_find_device - begin or continue searching for a PCI device by vendor/device id 149 * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids 150 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids 151 * @from: Previous PCI device found in search, or %NULL for new search. 152 * 153 * Iterates through the list of known PCI devices. If a PCI device is found 154 * with a matching @vendor and @device, a pointer to its device structure is 155 * returned. Otherwise, %NULL is returned. 156 * A new search is initiated by passing %NULL as the @from argument. 157 * Otherwise if @from is not %NULL, searches continue from next device 158 * on the global list. 159 * 160 * NOTE: Do not use this function any more; use pci_get_device() instead, as 161 * the PCI device returned by this function can disappear at any moment in 162 * time. 163 */ 164struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, 165 struct pci_dev *from) 166{ 167 struct pci_dev *pdev; 168 169 pci_dev_get(from); 170 pdev = pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from); 171 pci_dev_put(pdev); 172 return pdev; 173} 174EXPORT_SYMBOL(pci_find_device); 175#endif /* CONFIG_PCI_LEGACY */ 176 177/** 178 * pci_get_slot - locate PCI device for a given PCI slot 179 * @bus: PCI bus on which desired PCI device resides