[PATCH 2.6.34-rc1] proc: fix badness in fs/proc/generic.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: GuanJun He
Date: Wednesday, April 21, 2010 - 9:10 pm

fix badness in fs/proc/generic.c,  Bug 15589 -  2.6.34-rc1: Badness at
fs/proc/generic.c:316
this is just to get least waste.

Signed-off-by: Guanjun He <heguanbo@gmail.com>

---
diff -Nupr linux-2.6.34-rc1.orig/fs/proc/generic.c
linux-2.6.34-rc1/fs/proc/generic.c
--- linux-2.6.34-rc1.orig/fs/proc/generic.c     2010-03-09
02:45:44.000000000 +0800
+++ linux-2.6.34-rc1/fs/proc/generic.c  2010-04-22 11:32:00.000000000 +0800
@@ -313,7 +313,15 @@ static int __xlate_proc_name(const char
                                break;
                }
                if (!de) {
-                       WARN(1, "name '%s'\n", name);
+                       char *dup = kstrdup(name, GFP_KERNEL);
+                       if (dup) {
+                               cp = dup;
+                               while(*dup) {
+                                       if (*dup == '/')
+                                               *dup++ = '_';
+                               }
+                               WARN(1, "name '%s'\n", cp);
+                       }
                        return -ENOENT;
                }
                cp += len + 1;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2.6.34-rc1] proc: fix badness in fs/proc/generic.c, GuanJun He, (Wed Apr 21, 9:10 pm)
Re: [PATCH 2.6.34-rc1] proc: fix badness in fs/proc/generic.c, Alexey Dobriyan, (Wed Apr 21, 11:09 pm)