public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.34-rc1] fs: fix bad string output
@ 2010-04-21  8:59 GuanJun He
  2010-04-21 16:31 ` Américo Wang
  0 siblings, 1 reply; 2+ messages in thread
From: GuanJun He @ 2010-04-21  8:59 UTC (permalink / raw)
  To: linux-kernel

fix bad string output,[Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316

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-04-21
13:47:18.000000000 +0800
+++ linux-2.6.34-rc1/fs/proc/generic.c  2010-04-21 16:42:11.000000000 +0800
@@ -313,7 +313,14 @@ static int __xlate_proc_name(const char
                                break;
                }
                if (!de) {
-                       WARN(1, "name '%s'\n", name);
+                       cp = kstrdup(name);
+                       if (cp) {
+                               next = cp;
+                               while(*next) {
+                                       if (*next == '/')  *next++ = '_';
+                               }
+                               WARN(1, "name '%s'\n", cp);
+                       }
                        return -ENOENT;
                }
                cp += len + 1;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.34-rc1] fs: fix bad string output
  2010-04-21  8:59 [PATCH 2.6.34-rc1] fs: fix bad string output GuanJun He
@ 2010-04-21 16:31 ` Américo Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Américo Wang @ 2010-04-21 16:31 UTC (permalink / raw)
  To: GuanJun He; +Cc: linux-kernel

On Wed, Apr 21, 2010 at 04:59:40PM +0800, GuanJun He wrote:
>fix bad string output,[Bug #15589] 2.6.34-rc1: Badness at fs/proc/generic.c:316
>
>Signed-off-by: Guanjun He <heguanbo@gmail.com>
>

NACK.

This even doesn't pass compiling. Check the prototype of kstrdup().

Also, we already had a patch:

https://patchwork.kernel.org/patch/93658/


>---
>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-04-21
>13:47:18.000000000 +0800
>+++ linux-2.6.34-rc1/fs/proc/generic.c  2010-04-21 16:42:11.000000000 +0800
>@@ -313,7 +313,14 @@ static int __xlate_proc_name(const char
>                                break;
>                }
>                if (!de) {
>-                       WARN(1, "name '%s'\n", name);
>+                       cp = kstrdup(name);
>+                       if (cp) {
>+                               next = cp;
>+                               while(*next) {
>+                                       if (*next == '/')  *next++ = '_';
>+                               }
>+                               WARN(1, "name '%s'\n", cp);
>+                       }
>                        return -ENOENT;
>                }
>                cp += len + 1;
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Live like a child, think like the god.
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-21 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21  8:59 [PATCH 2.6.34-rc1] fs: fix bad string output GuanJun He
2010-04-21 16:31 ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox