Skip to content

Commit

Permalink
[PATCH] kstrdup: convert a few existing implementations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Love authored and Linus Torvalds committed Jun 23, 2005
1 parent 543537b commit dfe5224
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/um/kernel/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -322,12 +323,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);
}

int copy_to_user_proc(void __user *to, void *from, int size)
Expand Down

0 comments on commit dfe5224

Please sign in to comment.