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

[Xen-devel] [PATCH] pciback: fix circular loop in pcistub_match_one

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] pciback: fix circular loop in pcistub_match_one
From: Jon Mason <jdmason@xxxxxxxxxx>
Date: Tue, 1 Aug 2006 17:12:07 -0500
Cc: "Muli Ben-Yehuda \(IBM\)" <MULI@xxxxxxxxxx>, hap9@xxxxxxxxxxxxxx
Delivery-date: Tue, 01 Aug 2006 15:13:44 -0700
Envelope-to: www-data@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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx, hap9@xxxxxxxxxxxxxx, "Muli Ben-Yehuda (IBM)" <MULI@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
The for loop in pcistub_match_one will loop forever if the
dev->bus->self links to itself at the uppermost bridge.  Adding a check
to prevent linking back in on itself prevents this.

Thanks,
Jon

Signed-off-by: Jon Mason <jdmason@xxxxxxxxxx>

diff -r d2bf1a7cc131 linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c
--- a/linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c       Sat Jul 29 
14:05:59 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c       Tue Aug  1 
10:45:51 2006 -0500
@@ -232,6 +232,9 @@ static int __devinit pcistub_match_one(s
                    && dev->bus->number == pdev_id->bus
                    && dev->devfn == pdev_id->devfn)
                        return 1;
+
+               if (dev == dev->bus->self)
+                       break;
        }
 
        return 0;

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

<Prev in Thread] Current Thread [Next in Thread>