[SUNRPC]: Use k{mem,str}dup where applicable
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
af997d8c95
commit
e69062b4f7
@@ -76,10 +76,9 @@ simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res)
|
||||
q = (const void *)((const char *)p + len);
|
||||
if (unlikely(q > end || q < p))
|
||||
return ERR_PTR(-EFAULT);
|
||||
res->data = kmalloc(len, GFP_KERNEL);
|
||||
res->data = kmemdup(p, len, GFP_KERNEL);
|
||||
if (unlikely(res->data == NULL))
|
||||
return ERR_PTR(-ENOMEM);
|
||||
memcpy(res->data, p, len);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user