[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20081027074523.GA26094@parisc-linux.org>
Date: Mon, 27 Oct 2008 01:45:23 -0600
From: Matthew Wilcox <matthew@....cx>
To: "Zhao, Yu" <yu.zhao@...el.com>
Cc: Yu Zhao <yu.zhao@...scape.net>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"greg@...ah.com" <greg@...ah.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...nel.org" <stable@...nel.org>,
Rakib Mullick <rakib.mullick@...il.com>
Subject: Re: [PATCH] pci: Fixing drivers/pci/search.c compilation warning.
On Mon, Oct 27, 2008 at 03:34:14PM +0800, Zhao, Yu wrote:
> >Erm, no, the 'dev' cannot be destroyed because the caller has a refcount
> >on it. The physical device backing it might have gone away. The dev
>
> Why does the caller have a reference count? I don't see we increase the
> reference count after the 'dev' is returned by following in
> pci_get_dev_by_id():
>
> dev = bus_find_device(&pci_bus_type, dev_start, (void *)id,
> match_pci_dev_by_id);
>
> And this 'dev' becomes the 'from' in the next loop, but it may be
> destroyed before the 'pci_dev_get(from)', isn't it?
Either you've gone back to talking about pci_find_device() [which, yes, is
vulnerable to race conditions, we know that, it's not interesting to talk
about it], or you're refusing to take it on faith that pci_get_dev_by_id()
returns a device with an increased refcount. And if you don't believe
that is true, please follow the code in bus_find_device() to prove it.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists