linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christian Kujau <lists@nerdbynature.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linuxppc-dev@ozlabs.org, schwab@linux-m68k.org,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Maciej Rutecki <maciej.rutecki@gmail.com>
Subject: Re: [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316
Date: Wed, 21 Apr 2010 10:21:39 +1000	[thread overview]
Message-ID: <1271809299.13262.6.camel@concordia> (raw)
In-Reply-To: <20100421155547.GA4222@x200>

[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]

On Wed, 2010-04-21 at 18:55 +0300, Alexey Dobriyan wrote:
> On Tue, Apr 20, 2010 at 10:18:18PM +1000, Michael Ellerman wrote:
> > On Mon, 2010-04-19 at 23:45 -0700, Christian Kujau wrote:
> > --- a/fs/proc/proc_devtree.c
> > +++ b/fs/proc/proc_devtree.c
> > @@ -175,6 +175,24 @@ retry:
> >         return fixed_name;
> >  }
> >  
> > +static const char *unslash_name(const char *name)
> > +{
> > +       char *p, *fixed_name;
> > +
> > +       fixed_name = kstrdup(name);
> > +       if (!fixed_name) {
> > +               printk(KERN_ERR "device-tree: Out of memory trying to unslash "
> > +                               "name \"%s\"\n", name);
> > +               return name;
> > +       }
> > +
> > +       p = fixed_name;
> > +       while ((p = strstr(p, "/")))
> > +               *p++ = '_';
> 
> This is wasteful. :-)

Whatever, patches welcome :)

> Also, I hope we won't spit message every time allocation fail.

We do. Your system is mostly hosed anyway, but feel free to rate limit
it or something.

The error handling in there is a bit dubious, if the alloc fails we just
return the old name, which we know is bogus. It should probably return
NULL and the calling code can check - same for fixup_name().

cheers

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-04-21  0:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <deuQKFRcc0B.A.3EG.BRSzLB@tosh>
     [not found] ` <YeFfFNFyTSF.A.vUB.fSSzLB@tosh>
2010-04-20  6:45   ` [Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316 Christian Kujau
2010-04-20 12:18     ` Michael Ellerman
2010-04-20 18:15       ` Christian Kujau
2010-04-20 20:53         ` Andreas Schwab
2010-04-21  0:25         ` Michael Ellerman
2010-04-21 15:55       ` Alexey Dobriyan
2010-04-21  0:21         ` Michael Ellerman [this message]
2010-04-21  4:57           ` Rafael J. Wysocki
     [not found] <10aqDnTJcLO.A.mLE.48y5LB@chimera>
     [not found] ` <HqroMXsT-CJ.A.DnG.m_y5LB@chimera>
2010-05-09 22:27   ` Christian Kujau
2010-05-09 23:34     ` Michael Ellerman

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=1271809299.13262.6.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=adobriyan@gmail.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=lists@nerdbynature.de \
    --cc=maciej.rutecki@gmail.com \
    --cc=rjw@sisk.pl \
    --cc=schwab@linux-m68k.org \
    /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).