linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Sharyathi Nagesh <sharyath@in.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	Arjan van de Ven <arjan@infradead.org>,
	Sachin Sant <sachinp@in.ibm.com>
Subject: Re: Bug while executing : cat /proc/iomem on 2.6.17-rc1/rc2
Date: Thu, 11 May 2006 08:32:05 +0100	[thread overview]
Message-ID: <20060511073205.GA28693@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1147332468.17798.13.camel@localhost.localdomain>

On Thu, May 11, 2006 at 12:57:48PM +0530, Sharyathi Nagesh wrote:
> I was able to replicate the Bug, even when all the drivers are built into the kernel. 
> It looks like while traversing through p->parent field of resource structure is leading to NULL pointer. 
> Would it be appropriate to make the following code change. 
> 	But I found cat /proc/iomem hangs after line kernel data..
> 
> --- kernel/resource.c.old       2006-05-11 05:29:33.000000000 -0700
> +++ kernel/resource.c   2006-05-11 05:29:58.000000000 -0700
> @@ -81,7 +81,7 @@ static int r_show(struct seq_file *m, vo
>         int depth;
> 
>         for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent){
> -               if (p->parent == root)
> +               if (p->parent == root || p->parent == NULL)
>                         break;
>         }
>         seq_printf(m, "%*s%0*lx-%0*lx : %s\n",

Only the root should have a NULL parent, so this is just covering up some
other problem - you have a resource which somehow has illegally ended up
with a NULL parent pointer while it's been registered.

Maybe try adding:

		if (p->parent == NULL) {
			printk("resource with null parent: %lx-%lx: %s\n",
				p->start, p->end, p->name);
			break;
		}

just before the test in that loop, and then finding out why that resource
is becoming invalid.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

  reply	other threads:[~2006-05-11  7:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 10:43 Bug while executing : cat /proc/iomem on 2.6.17-rc1/rc2 Sachin Sant
2006-04-25 10:48 ` Arjan van de Ven
2006-05-11  7:27   ` Sharyathi Nagesh
2006-05-11  7:32     ` Russell King [this message]
2006-05-11  8:38       ` Sachin Sant
2006-05-13 10:30         ` Maneesh Soni
2006-05-13 14:56           ` Linus Torvalds

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=20060511073205.GA28693@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachinp@in.ibm.com \
    --cc=sharyath@in.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;
as well as URLs for NNTP newsgroup(s).