Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Liu Ping Fan <kernelfans@gmail.com>, <linux-pci@vger.kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] pci: bugfix, pci_get_domain_bus_and_slot() needs to inc reference count
Date: Tue, 12 Aug 2014 09:43:37 +0800	[thread overview]
Message-ID: <53E97149.8070303@huawei.com> (raw)
In-Reply-To: <1407803481-7910-1-git-send-email-pingfank@linux.vnet.ibm.com>

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)

> 
> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
> ---
>  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


  reply	other threads:[~2014-08-12  1:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  0:31 [PATCH] pci: bugfix, pci_get_domain_bus_and_slot() needs to inc reference count Liu Ping Fan
2014-08-12  1:43 ` Yijing Wang [this message]
2014-08-12  4:36   ` Liu ping fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53E97149.8070303@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=kernelfans@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox