<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Robert Love &lt;rml@novell.com&gt;

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 &lt;rml@novell.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 arch/um/kernel/process_kern.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff -puN arch/um/kernel/process_kern.c~kstrdup-convert-a-few-existing-implementations arch/um/kernel/process_kern.c
--- 25/arch/um/kernel/process_kern.c~kstrdup-convert-a-few-existing-implementations	2005-05-09 20:09:30.000000000 -0700
+++ 25-akpm/arch/um/kernel/process_kern.c	2005-05-09 20:09:30.000000000 -0700
@@ -8,6 +8,7 @@
 #include "linux/kernel.h"
 #include "linux/sched.h"
 #include "linux/interrupt.h"
+#include "linux/string.h"
 #include "linux/mm.h"
 #include "linux/slab.h"
 #include "linux/utsname.h"
@@ -341,12 +342,7 @@ void do_uml_exitcalls(void)
 
 char *uml_strdup(char *string)
 {
-	char *new;
-
-	new = kmalloc(strlen(string) + 1, GFP_KERNEL);
-	if(new == NULL) return(NULL);
-	strcpy(new, string);
-	return(new);
+	return kstrdup(string, GFP_KERNEL);
 }
 
 void *get_init_task(void)
_
</pre></body></html>