From: Greg KH <greg@kroah.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] pci_find_* to pci_get_*
Date: Mon, 20 Sep 2004 15:37:24 +0000 [thread overview]
Message-ID: <20040920153724.GC10513@kroah.com> (raw)
In-Reply-To: <1095662774.4052.10.camel@sfeldma-mobl2.dsl-verizon.net>
[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]
On Mon, Sep 20, 2004 at 12:39:44PM +0100, Matthew Wilcox wrote:
> On Mon, Sep 20, 2004 at 01:20:20AM -0700, Scott Feldman wrote:
> > diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> > --- a/drivers/net/e1000/e1000_main.c 2004-09-20 00:25:03 -07:00
> > +++ b/drivers/net/e1000/e1000_main.c 2004-09-20 00:25:03 -07:00
> > @@ -2789,9 +2789,10 @@
> > case SYS_DOWN:
> > case SYS_HALT:
> > case SYS_POWER_OFF:
> > - while((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
> > + while((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) {
> > if(pci_dev_driver(pdev) == &e1000_driver)
> > e1000_suspend(pdev, 3);
> > + pci_dev_put(pdev);
> > }
> > }
> > return NOTIFY_DONE;
>
> Ummm... there's still a race here. Between the pci_dev_put() returning and
> the invocation of pci_get_device(), the pdev can go away. I guess you have
> to do something like:
No you do not, please read the documentation for pci_get_device().
Actually this patch is incorrect for a different reason, that
pci_dev_put() is not needed at all, as pci_get_device() handles the put
on the device for you properly.
So, Scott, care to fix the patch?
Oh, and 1 patch per driver makes it easier for us to see these things :)
thanks,
greg k-h
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2004-09-20 15:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-20 6:46 [Kernel-janitors] pci_find_* to pci_get_* Scott Feldman
2004-09-20 7:03 ` Greg KH
2004-09-20 8:20 ` Scott Feldman
2004-09-20 11:39 ` Matthew Wilcox
2004-09-20 15:37 ` Greg KH [this message]
2004-09-20 15:38 ` Greg KH
2004-09-20 17:12 ` Christoph Hellwig
2004-09-20 18:16 ` Feldman, Scott
2004-09-20 18:25 ` Hanna Linder
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=20040920153724.GC10513@kroah.com \
--to=greg@kroah.com \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.