Message ID | alpine.DEB.2.01.1005091519130.3067@bogon.housecafe.de (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Sun, 2010-05-09 at 15:27 -0700, Christian Kujau wrote: > On Sun, 9 May 2010 at 23:17, Rafael J. Wysocki wrote: > > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=15589 > > Subject : 2.6.34-rc1: Badness at fs/proc/generic.c:316 > > Submitter : Christian Kujau <lists@nerdbynature.de> > > Date : 2010-03-13 23:53 (58 days old) > > Message-ID : <<alpine.DEB.2.01.1003131544340.5493@bogon.housecafe.de>> > > References : http://marc.info/?l=linux-kernel&m=126852442903680&w=2 > > The bug is still present in -rc6, but Michael Ellerman has a patch[0] > which made the warning go away. > > @Michael: will you post your patch with a Sign-Off, so that it can be > pushed into mainline? No, Benh and I decided it's better to just drop those properties all together. But it's too late in this cycle for a patch like that just to fix a warning - so we'll do that patch for 35. cheers
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index ce94801..019581d 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c @@ -176,6 +176,24 @@ retry: return fixed_name; } +static const char *unslash_name(const char *name) +{ + char *p, *fixed_name; + + fixed_name = kstrdup(name, GFP_KERNEL); + 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++ = '_'; + + return fixed_name; +} + /* * Process a node, adding entries for its children and its properties. */ @@ -212,6 +230,9 @@ void proc_device_tree_add_node(struct device_node *np, if (duplicate_name(de, p)) p = fixup_name(np, de, p); + if (strstr(p, "/")) + p = unslash_name(p); + ent = __proc_device_tree_add_prop(de, pp, p); if (ent == NULL) break;