From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Mason Subject: [PATCH] pciback: fix circular loop in pcistub_match_one Date: Tue, 1 Aug 2006 17:12:07 -0500 Message-ID: <20060801221206.GI8750@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: "Muli Ben-Yehuda (IBM)" , hap9@epoch.ncsc.mil List-Id: xen-devel@lists.xenproject.org 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 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;