diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:10 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:10 -0500 |
commit | a162a6b804b48c605d1fd35e1861a5d32d00ad3f (patch) | |
tree | 50b6aa7f5da5e4c34da2f9d34b93c667c5d6c054 /fs/nfs | |
parent | 967b9281361481aecf323563886ef972ee88c681 (diff) |
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback_xdr.c | 28 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 7c33b9a81a94..05c38cf40b69 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -330,7 +330,7 @@ static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res) | |||
330 | 330 | ||
331 | static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res) | 331 | static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res) |
332 | { | 332 | { |
333 | uint32_t *savep; | 333 | uint32_t *savep = NULL; |
334 | unsigned status = res->status; | 334 | unsigned status = res->status; |
335 | 335 | ||
336 | if (unlikely(status != 0)) | 336 | if (unlikely(status != 0)) |
@@ -358,23 +358,26 @@ static unsigned process_op(struct svc_rqst *rqstp, | |||
358 | struct xdr_stream *xdr_in, void *argp, | 358 | struct xdr_stream *xdr_in, void *argp, |
359 | struct xdr_stream *xdr_out, void *resp) | 359 | struct xdr_stream *xdr_out, void *resp) |
360 | { | 360 | { |
361 | struct callback_op *op; | 361 | struct callback_op *op = &callback_ops[0]; |
362 | unsigned int op_nr; | 362 | unsigned int op_nr = OP_CB_ILLEGAL; |
363 | unsigned int status = 0; | 363 | unsigned int status = 0; |
364 | long maxlen; | 364 | long maxlen; |
365 | unsigned res; | 365 | unsigned res; |
366 | 366 | ||
367 | dprintk("%s: start\n", __FUNCTION__); | 367 | dprintk("%s: start\n", __FUNCTION__); |
368 | status = decode_op_hdr(xdr_in, &op_nr); | 368 | status = decode_op_hdr(xdr_in, &op_nr); |
369 | if (unlikely(status != 0)) { | 369 | if (likely(status == 0)) { |
370 | op_nr = OP_CB_ILLEGAL; | 370 | switch (op_nr) { |
371 | op = &callback_ops[0]; | 371 | case OP_CB_GETATTR: |
372 | } else if (unlikely(op_nr != OP_CB_GETATTR && op_nr != OP_CB_RECALL)) { | 372 | case OP_CB_RECALL: |
373 | op_nr = OP_CB_ILLEGAL; | 373 | op = &callback_ops[op_nr]; |
374 | op = &callback_ops[0]; | 374 | break; |
375 | status = htonl(NFS4ERR_OP_ILLEGAL); | 375 | default: |
376 | } else | 376 | op_nr = OP_CB_ILLEGAL; |
377 | op = &callback_ops[op_nr]; | 377 | op = &callback_ops[0]; |
378 | status = htonl(NFS4ERR_OP_ILLEGAL); | ||
379 | } | ||
380 | } | ||
378 | 381 | ||
379 | maxlen = xdr_out->end - xdr_out->p; | 382 | maxlen = xdr_out->end - xdr_out->p; |
380 | if (maxlen > 0 && maxlen < PAGE_SIZE) { | 383 | if (maxlen > 0 && maxlen < PAGE_SIZE) { |
@@ -416,6 +419,7 @@ static int nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp | |||
416 | decode_compound_hdr_arg(&xdr_in, &hdr_arg); | 419 | decode_compound_hdr_arg(&xdr_in, &hdr_arg); |
417 | hdr_res.taglen = hdr_arg.taglen; | 420 | hdr_res.taglen = hdr_arg.taglen; |
418 | hdr_res.tag = hdr_arg.tag; | 421 | hdr_res.tag = hdr_arg.tag; |
422 | hdr_res.nops = NULL; | ||
419 | encode_compound_hdr_res(&xdr_out, &hdr_res); | 423 | encode_compound_hdr_res(&xdr_out, &hdr_res); |
420 | 424 | ||
421 | for (;;) { | 425 | for (;;) { |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 305bea201cd3..77a565eba562 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -908,7 +908,7 @@ out_put_state_owner: | |||
908 | static struct nfs4_state *nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred) | 908 | static struct nfs4_state *nfs4_open_delegated(struct inode *inode, int flags, struct rpc_cred *cred) |
909 | { | 909 | { |
910 | struct nfs4_exception exception = { }; | 910 | struct nfs4_exception exception = { }; |
911 | struct nfs4_state *res; | 911 | struct nfs4_state *res = ERR_PTR(-EIO); |
912 | int err; | 912 | int err; |
913 | 913 | ||
914 | do { | 914 | do { |