mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
sunrpc: use kmemdup_nul() in gssp_stringify()
It is more efficient to use kmemdup_nul() if the size is known exactly . According to doc: "Note: Use kmemdup_nul() instead if the size is known exactly." Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
c25bf185e5
commit
1eb2f96d0b
1 changed files with 1 additions and 1 deletions
|
@ -223,7 +223,7 @@ static int gssp_alloc_receive_pages(struct gssx_arg_accept_sec_context *arg)
|
|||
|
||||
static char *gssp_stringify(struct xdr_netobj *netobj)
|
||||
{
|
||||
return kstrndup(netobj->data, netobj->len, GFP_KERNEL);
|
||||
return kmemdup_nul(netobj->data, netobj->len, GFP_KERNEL);
|
||||
}
|
||||
|
||||
static void gssp_hostbased_service(char **principal)
|
||||
|
|
Loading…
Reference in a new issue