public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Michael Ellerman <michael@ellerman.id.au>
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 18:55:47 +0300	[thread overview]
Message-ID: <20100421155547.GA4222@x200> (raw)
In-Reply-To: <1271765898.4324.2.camel@concordia>

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. :-)
Also, I hope we won't spit message every time allocation fail.

  parent reply	other threads:[~2010-04-20 15:54 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 [this message]
2010-04-21  0:21         ` Michael Ellerman
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=20100421155547.GA4222@x200 \
    --to=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=michael@ellerman.id.au \
    --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