WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] pci_remove_device: fix linked list discipline

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] pci_remove_device: fix linked list discipline
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Mon, 23 May 2011 10:55:54 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 23 May 2011 03:27:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DD6A7E302000078000428AA@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7b12c46b18777655c8a5.1305708795@xxxxxxxxxxxxxxxxxxxxxxx> <4DD6A7E302000078000428AA@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
At 16:41 +0100 on 20 May (1305909715), Jan Beulich wrote:
> > diff -r f531ed84b066 -r 7b12c46b1877 xen/drivers/passthrough/pci.c
> > --- a/xen/drivers/passthrough/pci.c Tue May 17 17:32:19 2011 +0100
> > +++ b/xen/drivers/passthrough/pci.c Wed May 18 09:52:20 2011 +0100
> > @@ -173,11 +173,11 @@ out:
> >  
> >  int pci_remove_device(u8 bus, u8 devfn)
> >  {
> > -    struct pci_dev *pdev;
> > +    struct pci_dev *pdev, *tmp;
> >      int ret = -ENODEV;
> >  
> >      spin_lock(&pcidevs_lock);
> > -    list_for_each_entry ( pdev, &alldevs_list, alldevs_list )
> > +    list_for_each_entry_safe ( pdev, tmp, &alldevs_list, alldevs_list )
> 
> Somehow I overlooked this patch when it was sent - looking at the
> code it modifies I can't see why the ..._safe() variant is necessary
> here, as there's a break statement following the list deletion.

Ah - good point.  I'll go back to the crash report I thought this fixed
and take another look. :)

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel