aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorAlakesh Haloi <alakesh.haloi@gmail.com>2019-03-26 02:00:01 +0000
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-03-26 13:04:32 -0700
commit01f2f5b82a2b523ae76af53f2ff43c48dde10a00 (patch)
treeed85bd1061cc859e6a1d35c4f9e86e0548194a29 /net/sunrpc
parentpNFS/flexfiles: Fix layoutstats handling during read failovers (diff)
downloadlinux-dev-01f2f5b82a2b523ae76af53f2ff43c48dde10a00.tar.xz
linux-dev-01f2f5b82a2b523ae76af53f2ff43c48dde10a00.zip
SUNRPC: fix uninitialized variable warning
Avoid following compiler warning on uninitialized variable net/sunrpc/xprtsock.c: In function ‘xs_read_stream_request.constprop’: net/sunrpc/xprtsock.c:525:10: warning: ‘read’ may be used uninitialized in this function [-Wmaybe-uninitialized] return read; ^~~~ net/sunrpc/xprtsock.c:529:23: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret < 0 ? ret : read; ~~~~~~~~~~~~~~^~~~~~ Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 9359539907ba..732d4b57411a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -495,8 +495,8 @@ xs_read_stream_request(struct sock_xprt *transport, struct msghdr *msg,
int flags, struct rpc_rqst *req)
{
struct xdr_buf *buf = &req->rq_private_buf;
- size_t want, read;
- ssize_t ret;
+ size_t want, uninitialized_var(read);
+ ssize_t uninitialized_var(ret);
xs_read_header(transport, buf);