ia64/xen-unstable

changeset 10899:10dc10473c3f

[PCI] back: Fix potential infinite loop in pcistub_match_one().

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.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
author kfraser@localhost.localdomain
date Wed Aug 02 09:15:26 2006 +0100 (2006-08-02)
parents 10b05c2e7947
children bbc27b921e2a
files linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c	Tue Aug 01 18:08:01 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/pciback/pci_stub.c	Wed Aug 02 09:15:26 2006 +0100
     1.3 @@ -232,6 +232,10 @@ static int __devinit pcistub_match_one(s
     1.4  		    && dev->bus->number == pdev_id->bus
     1.5  		    && dev->devfn == pdev_id->devfn)
     1.6  			return 1;
     1.7 +
     1.8 +		/* Sometimes topmost bridge links to itself. */
     1.9 +		if (dev == dev->bus->self)
    1.10 +			break;
    1.11  	}
    1.12  
    1.13  	return 0;