sunrpc: use kmemdup_nul() in gssp_stringify()
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/auth_gss/gss_rpc_upcall.c +1 -1
@@ -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)
Signature · 1 line
2.20.1
J. Bruce Fields
AppliedThanks, applied.--b.
Quoted 26 lines · Chen Zhou
It is more efficient to use
kmemdup_nul()if the size is known exactly .According to doc:
"Note: Usekmemdup_nul()instead if the size is known exactly."Signed-off-by Chen Zhou <[email protected]>--- net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/sunrpc/auth_gss/gss_rpc_upcall.c +1
-1@@ -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)Signature · 1 line
2.20.1