mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Rose <johnrose@austin.ibm.com>
To: torvalds@osdl.org
Cc: greg@kroah.org, lkml <linux-kernel@vger.kernel.org>,
	Mike Wortman <wortman@us.ibm.com>
Subject: [PATCH] insert_resource fix
Date: Tue, 15 Jun 2004 10:41:34 -0500	[thread overview]
Message-ID: <1087314094.3094.9.camel@sinatra.austin.ibm.com> (raw)

Hi Linus, Greg-

I sent this yesterday to lkml, but forgot to copy Linus and forgot to
sign off.  And I used the wrong address for Greg :)

Noticed that insert_resource() incorrectly handles the case of an existing
parent resource with the same ending address as a newly added child.  This
results in incorrect nesting, like the following:

# cat /proc/ioports
<snip>
002f0000-002fffff : PCI Bus #48
  00200000-002fffff : /pci@800000020000003
</snip>

Thanks-
John

Signed-off-by: John Rose <johnrose@austin.ibm.com>

diff -Nru a/kernel/resource.c b/kernel/resource.c
--- a/kernel/resource.c	Mon Jun 14 15:42:29 2004
+++ b/kernel/resource.c	Mon Jun 14 15:42:29 2004
@@ -332,8 +332,8 @@
 		if (next->sibling->start > new->end)
 			break;
 
-	/* existing resource overlaps end of new resource */
-	if (next->end > new->end) {
+	/* existing resource includes new resource */
+	if (next->end >= new->end) {
 		parent = next;
 		result = 0;
 		goto begin;


                 reply	other threads:[~2004-06-15 15:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1087314094.3094.9.camel@sinatra.austin.ibm.com \
    --to=johnrose@austin.ibm.com \
    --cc=greg@kroah.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=wortman@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®