Commit a162a6b8 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Kill braindead gcc warnings

nfs4_open_revalidate: 'res' may be used uninitialized
nfs4_callback_compound: ‘hdr_res.nops’ may be used uninitialized
			'op_nr’ may be used uninitialized
encode_getattr_res: ‘savep’ may be used uninitialized
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 967b9281
...@@ -330,7 +330,7 @@ static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res) ...@@ -330,7 +330,7 @@ static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res)
static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res) static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res)
{ {
uint32_t *savep; uint32_t *savep = NULL;
unsigned status = res->status; unsigned status = res->status;
if (unlikely(status != 0)) if (unlikely(status != 0))
...@@ -358,23 +358,26 @@ static unsigned process_op(struct svc_rqst *rqstp, ...@@ -358,23 +358,26 @@ static unsigned process_op(struct svc_rqst *rqstp,
struct xdr_stream *xdr_in, void *argp, struct xdr_stream *xdr_in, void *argp,
struct xdr_stream *xdr_out, void *resp) struct xdr_stream *xdr_out, void *resp)
{ {
struct callback_op *op; struct callback_op *op = &callback_ops[0];
unsigned int op_nr; unsigned int op_nr = OP_CB_ILLEGAL;
unsigned int status = 0; unsigned int status = 0;
long maxlen; long maxlen;
unsigned res; unsigned res;
dprintk("%s: start\n", __FUNCTION__); dprintk("%s: start\n", __FUNCTION__);
status = decode_op_hdr(xdr_in, &op_nr); status = decode_op_hdr(xdr_in, &op_nr);
if (unlikely(status != 0)) { if (likely(status == 0)) {
op_nr = OP_CB_ILLEGAL; switch (op_nr) {
op = &callback_ops[0]; case OP_CB_GETATTR:
} else if (unlikely(op_nr != OP_CB_GETATTR && op_nr != OP_CB_RECALL)) { case OP_CB_RECALL:
op_nr = OP_CB_ILLEGAL; op = &callback_ops[op_nr];
op = &callback_ops[0]; break;
status = htonl(NFS4ERR_OP_ILLEGAL); default:
} else op_nr = OP_CB_ILLEGAL;
op = &callback_ops[op_nr]; op = &callback_ops[0];
status = htonl(NFS4ERR_OP_ILLEGAL);
}
}
maxlen = xdr_out->end - xdr_out->p; maxlen = xdr_out->end - xdr_out->p;
if (maxlen > 0 && maxlen < PAGE_SIZE) { if (maxlen > 0 && maxlen < PAGE_SIZE) {
...@@ -416,6 +419,7 @@ static int nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp ...@@ -416,6 +419,7 @@ static int nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp
decode_compound_hdr_arg(&xdr_in, &hdr_arg); decode_compound_hdr_arg(&xdr_in, &hdr_arg);
hdr_res.taglen = hdr_arg.taglen; hdr_res.taglen = hdr_arg.taglen;
hdr_res.tag = hdr_arg.tag; hdr_res.tag = hdr_arg.tag;
hdr_res.nops = NULL;
encode_compound_hdr_res(&xdr_out, &hdr_res); encode_compound_hdr_res(&xdr_out, &hdr_res);
for (;;) { for (;;) {
......
...@@ -908,7 +908,7 @@ out_put_state_owner: ...@@ -908,7 +908,7 @@ out_put_state_owner:
static struct nfs4_state *nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred) static struct nfs4_state *nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred)
{ {
struct nfs4_exception exception = { }; struct nfs4_exception exception = { };
struct nfs4_state *res; struct nfs4_state *res = ERR_PTR(-EIO);
int err; int err;
do { do {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment