• Matthew Wilcox's avatar
    PCI: Fix reference counting bug · c4ed02fa
    Matthew Wilcox authored
    pci_get_subsys() will decrement the reference count of the device that
    it starts searching from.  Unfortunately, the pci_find_device() interface
    will already have decremented the reference count of the device earlier,
    so the device will end up losing all reference counts and be freed.
    
    We can fix this by incrementing the reference count of the device to
    start searching from before calling pci_get_subsys().
    Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    c4ed02fa
search.c 13.2 KB