lkml.org 
[lkml]   [2005]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6] 5/7 use kstrdup library function in net/sunrpc/svcauth_unix.c

This patch removes a private strdup in net/sunrpc/svcauth_unix.c, and updates it
to use the kstrdup library function.

Signed-off-by: Paulo Marques <pmarques@grupopie.com>

--
Paulo Marques - www.grupopie.com

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
--- vanilla-2.6.11-rc2-bk9/net/sunrpc/svcauth_unix.c 2005-01-31 20:05:34.000000000 +0000
+++ linux-2.6.11-rc2-bk9/net/sunrpc/svcauth_unix.c 2005-01-31 20:36:28.536400791 +0000
@@ -8,6 +8,7 @@
#include <linux/err.h>
#include <linux/seq_file.h>
#include <linux/hash.h>
+#include <linux/string.h>

#define RPCDBG_FACILITY RPCDBG_AUTH

@@ -20,14 +21,6 @@
*/


-static char *strdup(char *s)
-{
- char *rv = kmalloc(strlen(s)+1, GFP_KERNEL);
- if (rv)
- strcpy(rv, s);
- return rv;
-}
-
struct unix_domain {
struct auth_domain h;
int addr_changes;
@@ -55,7 +48,7 @@ struct auth_domain *unix_domain_find(cha
if (new == NULL)
return NULL;
cache_init(&new->h.h);
- new->h.name = strdup(name);
+ new->h.name = kstrdup(name, GFP_KERNEL);
new->h.flavour = RPC_AUTH_UNIX;
new->addr_changes = 0;
new->h.h.expiry_time = NEVER;
\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.035 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site