提交 01f2f5b8 编写于 作者: A Alakesh Haloi 提交者: Trond Myklebust

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: NAlakesh Haloi <alakesh.haloi@gmail.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
上级 166bd5b8
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册