aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRobert Love <rml@novell.com>2005-06-23 03:09:04 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:18 -0400
commitdfe52244e004f5103478966cd88351feb5c50d79 (patch)
treee8642138b3ff31a799c208c0b2a6562885d76092 /arch
parent543537bd922692bc978e2e356fcd8bfc9c2ee7d5 (diff)
[PATCH] kstrdup: convert a few existing implementations
Convert a bunch of strdup() implementations and their callers to the new kstrdup(). A few remain, for example see sound/core, and there are tons of open coded strdup()'s around. Sigh. But this is a start. Signed-off-by: Robert Love <rml@novell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/kernel/process_kern.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
index 804c6bbdf67c..157584ae4792 100644
--- a/arch/um/kernel/process_kern.c
+++ b/arch/um/kernel/process_kern.c
@@ -8,6 +8,7 @@
8#include "linux/kernel.h" 8#include "linux/kernel.h"
9#include "linux/sched.h" 9#include "linux/sched.h"
10#include "linux/interrupt.h" 10#include "linux/interrupt.h"
11#include "linux/string.h"
11#include "linux/mm.h" 12#include "linux/mm.h"
12#include "linux/slab.h" 13#include "linux/slab.h"
13#include "linux/utsname.h" 14#include "linux/utsname.h"
@@ -322,12 +323,7 @@ void do_uml_exitcalls(void)
322 323
323char *uml_strdup(char *string) 324char *uml_strdup(char *string)
324{ 325{
325 char *new; 326 return kstrdup(string, GFP_KERNEL);
326
327 new = kmalloc(strlen(string) + 1, GFP_KERNEL);
328 if(new == NULL) return(NULL);
329 strcpy(new, string);
330 return(new);
331} 327}
332 328
333int copy_to_user_proc(void __user *to, void *from, int size) 329int copy_to_user_proc(void __user *to, void *from, int size)