Re: [PATCH] pci: bugfix, pci_get_domain_bus_and_slot() needs to inc reference count

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

 



On Tue, Aug 12, 2014 at 9:43 AM, Yijing Wang <wangyijing@xxxxxxxxxx> wrote:
> On 2014/8/12 8:31, Liu Ping Fan wrote:
>> As the notes of this function, pci_get_domain_bus_and_slot() should
>> increase the reference count.
>
> It had did it.
> please refer to:
>
> #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
>
Oh, got it.

Thx!
>>
>> Signed-off-by: Liu Ping Fan <pingfank@xxxxxxxxxxxxxxxxxx>
>> ---
>>  drivers/pci/search.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/search.c b/drivers/pci/search.c
>> index 827ad83..41a5738 100644
>> --- a/drivers/pci/search.c
>> +++ b/drivers/pci/search.c
>> @@ -258,8 +258,10 @@ struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
>>
>>       for_each_pci_dev(dev) {
>>               if (pci_domain_nr(dev->bus) == domain &&
>> -                 (dev->bus->number == bus && dev->devfn == devfn))
>> +                 (dev->bus->number == bus && dev->devfn == devfn)) {
>> +                     pci_dev_get(dev);
>>                       return dev;
>> +             }
>>       }
>>       return NULL;
>>  }
>>
>
>
> --
> Thanks!
> Yijing
>
--
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