All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Mason <jdmason@us.ibm.com>
To: xen-devel@lists.xensource.com
Cc: "Muli Ben-Yehuda (IBM)" <MULI@il.ibm.com>, hap9@epoch.ncsc.mil
Subject: [PATCH] pciback: fix circular loop in pcistub_match_one
Date: Tue, 1 Aug 2006 17:12:07 -0500	[thread overview]
Message-ID: <20060801221206.GI8750@us.ibm.com> (raw)

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;

             reply	other threads:[~2006-08-01 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01 22:12 Jon Mason [this message]
2006-08-02  5:52 ` [PATCH] pciback: fix circular loop in pcistub_match_one Muli Ben-Yehuda
2006-08-02 15:41   ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060801221206.GI8750@us.ibm.com \
    --to=jdmason@us.ibm.com \
    --cc=MULI@il.ibm.com \
    --cc=hap9@epoch.ncsc.mil \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.