diff options
author | J. Bruce Fields <bfields@fieldses.org> | 2006-10-17 03:10:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-17 11:18:46 -0400 |
commit | 0942176f4353ffebcd6e3f95abce9fd8e24f2cb1 (patch) | |
tree | 9a1d63914b9e13f9f01ebb31aa747c18c8998dcb /fs/nfsd/nfs4callback.c | |
parent | 9801d8a39cfe6c34f39f9552a246a6bd002e735e (diff) |
[PATCH] knfsd: nfsd4: Fix error handling in nfsd's callback client
Coverity noticed that the error handling code in the NFSv4 callback client
sets cb->cb_client to NULL, then calls rpc_shutdown_client with the NULL
pointer.
Coverity: #cid 1397
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index f6ca9fb3fc63..324a278f2808 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -421,7 +421,7 @@ nfsd4_probe_callback(struct nfs4_client *clp) | |||
421 | 421 | ||
422 | /* Create RPC client */ | 422 | /* Create RPC client */ |
423 | cb->cb_client = rpc_create(&args); | 423 | cb->cb_client = rpc_create(&args); |
424 | if (!cb->cb_client) { | 424 | if (IS_ERR(cb->cb_client)) { |
425 | dprintk("NFSD: couldn't create callback client\n"); | 425 | dprintk("NFSD: couldn't create callback client\n"); |
426 | goto out_err; | 426 | goto out_err; |
427 | } | 427 | } |
@@ -448,10 +448,10 @@ nfsd4_probe_callback(struct nfs4_client *clp) | |||
448 | out_rpciod: | 448 | out_rpciod: |
449 | atomic_dec(&clp->cl_count); | 449 | atomic_dec(&clp->cl_count); |
450 | rpciod_down(); | 450 | rpciod_down(); |
451 | cb->cb_client = NULL; | ||
452 | out_clnt: | 451 | out_clnt: |
453 | rpc_shutdown_client(cb->cb_client); | 452 | rpc_shutdown_client(cb->cb_client); |
454 | out_err: | 453 | out_err: |
454 | cb->cb_client = NULL; | ||
455 | dprintk("NFSD: warning: no callback path to client %.*s\n", | 455 | dprintk("NFSD: warning: no callback path to client %.*s\n", |
456 | (int)clp->cl_name.len, clp->cl_name.data); | 456 | (int)clp->cl_name.len, clp->cl_name.data); |
457 | } | 457 | } |