summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorMalahal Naineni <malahal@us.ibm.com>2011-09-20 17:27:14 -0700
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-10-20 18:44:04 -0500
commit940aab490215424a269f93d2eba2794fc8b3e269 (patch)
tree6dec5a3d9476fd3c409d7a73040e0eafb1eba756 /fs/nfs
parentb6ee8cd2642f6d822dd1a4ba62298b65ff99b72e (diff)
downloadlinux-stable-940aab490215424a269f93d2eba2794fc8b3e269.tar.gz
linux-stable-940aab490215424a269f93d2eba2794fc8b3e269.tar.bz2
linux-stable-940aab490215424a269f93d2eba2794fc8b3e269.zip
Check validity of cl_rpcclient in nfs_server_list_show
As soon as the nfs_client gets created, its cl_rpcclient is set to ERR_PTR(-EINVAL). The rpc client structure is allocated later. Check if the client is ready before using the cl_rpcclient pointer. Signed-off-by: Malahal Naineni <malahal@us.ibm.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index b4e41dd4d0f6..873bf00d51a2 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1868,6 +1868,10 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
/* display one transport per line on subsequent lines */
clp = list_entry(v, struct nfs_client, cl_share_link);
+ /* Check if the client is initialized */
+ if (clp->cl_cons_state != NFS_CS_READY)
+ return 0;
+
seq_printf(m, "v%u %s %s %3d %s\n",
clp->rpc_ops->version,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR),