Re: [PATCH] PCI: check if a bus is added before removing it

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

 



On Tue, Jan 27, 2009 at 12:00:00AM +0800, Yu Zhao wrote:
> On Sun, Jan 25, 2009 at 05:25:02AM +0800, Greg KH wrote:
> > On Sun, Jan 25, 2009 at 12:41:34AM +0800, Yu Zhao wrote:
> > > Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>
> > > ---
> > >  drivers/pci/remove.c |    3 +++
> > >  1 files changed, 3 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
> > > index 042e089..caf8e1e 100644
> > > --- a/drivers/pci/remove.c
> > > +++ b/drivers/pci/remove.c
> > > @@ -71,6 +71,9 @@ void pci_remove_bus(struct pci_bus *pci_bus)
> > >  	down_write(&pci_bus_sem);
> > >  	list_del(&pci_bus->node);
> > >  	up_write(&pci_bus_sem);
> > > +	if (!pci_bus->is_added)
> > > +		return;
> > 
> > What race condition is this solving?
> 
> pci_bus_add_child() sets the 'is_added' if a bus is successfully
> registered, so I guess the reverse operation should check it too.
> Otherwise, the 'is_added' is useless and should be removed :-)

Then I suggest you document this in the changelog message for the patch
:)

thanks,

greg k-h
--
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