diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-11-20 22:21:34 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:30:20 -0500 |
commit | e69062b4f728dca01ec1a9eb4ed55b73a374f164 (patch) | |
tree | 6f8fe0800c07bb53a47bab00e8dfdb4ff9a912e2 /net/sunrpc/auth_gss/svcauth_gss.c | |
parent | af997d8c9568d556cd0a362d56de9fb14a6a012a (diff) |
[SUNRPC]: Use k{mem,str}dup where applicable
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 1f0f079ffa65..700353b330fd 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -113,9 +113,7 @@ static int rsi_match(struct cache_head *a, struct cache_head *b) | |||
113 | static int dup_to_netobj(struct xdr_netobj *dst, char *src, int len) | 113 | static int dup_to_netobj(struct xdr_netobj *dst, char *src, int len) |
114 | { | 114 | { |
115 | dst->len = len; | 115 | dst->len = len; |
116 | dst->data = (len ? kmalloc(len, GFP_KERNEL) : NULL); | 116 | dst->data = (len ? kmemdup(src, len, GFP_KERNEL) : NULL); |
117 | if (dst->data) | ||
118 | memcpy(dst->data, src, len); | ||
119 | if (len && !dst->data) | 117 | if (len && !dst->data) |
120 | return -ENOMEM; | 118 | return -ENOMEM; |
121 | return 0; | 119 | return 0; |
@@ -756,10 +754,9 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) | |||
756 | if (!new) | 754 | if (!new) |
757 | goto out; | 755 | goto out; |
758 | kref_init(&new->h.ref); | 756 | kref_init(&new->h.ref); |
759 | new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL); | 757 | new->h.name = kstrdup(name, GFP_KERNEL); |
760 | if (!new->h.name) | 758 | if (!new->h.name) |
761 | goto out_free_dom; | 759 | goto out_free_dom; |
762 | strcpy(new->h.name, name); | ||
763 | new->h.flavour = &svcauthops_gss; | 760 | new->h.flavour = &svcauthops_gss; |
764 | new->pseudoflavor = pseudoflavor; | 761 | new->pseudoflavor = pseudoflavor; |
765 | 762 | ||