|
@@ -113,9 +113,7 @@ static int rsi_match(struct cache_head *a, struct cache_head *b)
|
|
static int dup_to_netobj(struct xdr_netobj *dst, char *src, int len)
|
|
static int dup_to_netobj(struct xdr_netobj *dst, char *src, int len)
|
|
{
|
|
{
|
|
dst->len = len;
|
|
dst->len = len;
|
|
- dst->data = (len ? kmalloc(len, GFP_KERNEL) : NULL);
|
|
|
|
- if (dst->data)
|
|
|
|
- memcpy(dst->data, src, len);
|
|
|
|
|
|
+ dst->data = (len ? kmemdup(src, len, GFP_KERNEL) : NULL);
|
|
if (len && !dst->data)
|
|
if (len && !dst->data)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
return 0;
|
|
return 0;
|
|
@@ -756,10 +754,9 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
|
|
if (!new)
|
|
if (!new)
|
|
goto out;
|
|
goto out;
|
|
kref_init(&new->h.ref);
|
|
kref_init(&new->h.ref);
|
|
- new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL);
|
|
|
|
|
|
+ new->h.name = kstrdup(name, GFP_KERNEL);
|
|
if (!new->h.name)
|
|
if (!new->h.name)
|
|
goto out_free_dom;
|
|
goto out_free_dom;
|
|
- strcpy(new->h.name, name);
|
|
|
|
new->h.flavour = &svcauthops_gss;
|
|
new->h.flavour = &svcauthops_gss;
|
|
new->pseudoflavor = pseudoflavor;
|
|
new->pseudoflavor = pseudoflavor;
|
|
|
|
|