Jon Mason
2006-Aug-01 22:12 UTC
[Xen-devel] [PATCH] pciback: fix circular 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. Thanks, Jon Signed-off-by: Jon Mason <jdmason@us.ibm.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Muli Ben-Yehuda
2006-Aug-02 05:52 UTC
[Xen-devel] Re: [PATCH] pciback: fix circular loop in pcistub_match_one
On Tue, Aug 01, 2006 at 05:12:07PM -0500, Jon Mason wrote:> 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.Also, please apply & push to our xenlinux tree (or I''ll do it if you prefer) Cheers, Muli _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jon Mason
2006-Aug-02 15:41 UTC
[Xen-devel] Re: [PATCH] pciback: fix circular loop in pcistub_match_one
On Wed, Aug 02, 2006 at 08:52:00AM +0300, Muli Ben-Yehuda wrote:> On Tue, Aug 01, 2006 at 05:12:07PM -0500, Jon Mason wrote: > > 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. > > Also, please apply & push to our xenlinux tree (or I''ll do it if you prefer)Will do. Thanks, Jon> > Cheers, > Muli_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel