mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
PCI: Fix reference count leak in pci_dev_present()
Function pci_get_dev_by_id() takes a reference on the pci_dev returned, so pci_dev_present() should release the corresponding reference. Signed-off-by: Jiang Liu <[email protected]> Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
7629d19a4d
commit
d5af7d987a
1 changed files with 5 additions and 5 deletions
|
|
@ -319,13 +319,13 @@ int pci_dev_present(const struct pci_device_id *ids)
|
|||
WARN_ON(in_interrupt());
|
||||
while (ids->vendor || ids->subvendor || ids->class_mask) {
|
||||
found = pci_get_dev_by_id(ids, NULL);
|
||||
if (found)
|
||||
goto exit;
|
||||
if (found) {
|
||||
pci_dev_put(found);
|
||||
return 1;
|
||||
}
|
||||
ids++;
|
||||
}
|
||||
exit:
|
||||
if (found)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(pci_dev_present);
|
||||
|
|
|
|||
Loading…
Reference in a new issue