projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a70163
)
SUNRPC: Fix up open coded kmemdup_nul()
author
Trond Myklebust
<trond.myklebust@hammerspace.com>
Tue, 10 Nov 2020 15:56:53 +0000
(10:56 -0500)
committer
Trond Myklebust
<trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:53 +0000
(14:05 -0500)
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xdr.c
patch
|
blob
|
history
diff --git
a/net/sunrpc/xdr.c
b/net/sunrpc/xdr.c
index 71e03b930b70a3ac9e84d8a50d4cefb4d5ece69f..b1cda6d85dede4cca0fe7fc9cf75bc00165f1946 100644
(file)
--- a/
net/sunrpc/xdr.c
+++ b/
net/sunrpc/xdr.c
@@
-1942,10
+1942,8
@@
ssize_t xdr_stream_decode_string_dup(struct xdr_stream *xdr, char **str,
ret = xdr_stream_decode_opaque_inline(xdr, &p, maxlen);
if (ret > 0) {
- char *s = km
alloc(ret + 1
, gfp_flags);
+ char *s = km
emdup_nul(p, ret
, gfp_flags);
if (s != NULL) {
- memcpy(s, p, ret);
- s[ret] = '\0';
*str = s;
return strlen(s);
}