diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-08-10 08:54:16 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-10 08:54:16 -0400 |
commit | e576e05a73bc1a00cdf56630942dbada1bf280a1 (patch) | |
tree | d32f477a91b01bcdbccc272be2ebaaef287421bb /fs/nfs | |
parent | 38c73044f5f4da2ef4339319b170e5e19f8dec87 (diff) |
nfs: remove superfluous BUG_ON()s
Subject: [PATCH] nfs: remove superfluous BUG_ON()s
Remove duplicated BUG_ON()s from nfs[4]_create_server()
(we make the same checks earlier in both functions).
This takes care of the following entries from Dan's list:
fs/nfs/client.c +1078 nfs_create_server(47) warning: variable derefenced before check 'server->nfs_client'
fs/nfs/client.c +1079 nfs_create_server(48) warning: variable derefenced before check 'server->nfs_client->rpc_ops'
fs/nfs/client.c +1363 nfs4_create_server(43) warning: variable derefenced before check 'server->nfs_client'
fs/nfs/client.c +1364 nfs4_create_server(44) warning: variable derefenced before check 'server->nfs_
Reported-by: Dan Carpenter <error27@gmail.com>
Cc: corbet@lwn.net
Cc: eteo@redhat.com
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 8f34fd8028fc..d36925f9b952 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1077,10 +1077,6 @@ struct nfs_server *nfs_create_server(const struct nfs_parsed_mount_data *data, | |||
1077 | (unsigned long long) server->fsid.major, | 1077 | (unsigned long long) server->fsid.major, |
1078 | (unsigned long long) server->fsid.minor); | 1078 | (unsigned long long) server->fsid.minor); |
1079 | 1079 | ||
1080 | BUG_ON(!server->nfs_client); | ||
1081 | BUG_ON(!server->nfs_client->rpc_ops); | ||
1082 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); | ||
1083 | |||
1084 | spin_lock(&nfs_client_lock); | 1080 | spin_lock(&nfs_client_lock); |
1085 | list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks); | 1081 | list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks); |
1086 | list_add_tail(&server->master_link, &nfs_volume_list); | 1082 | list_add_tail(&server->master_link, &nfs_volume_list); |
@@ -1362,10 +1358,6 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data, | |||
1362 | if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN) | 1358 | if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN) |
1363 | server->namelen = NFS4_MAXNAMLEN; | 1359 | server->namelen = NFS4_MAXNAMLEN; |
1364 | 1360 | ||
1365 | BUG_ON(!server->nfs_client); | ||
1366 | BUG_ON(!server->nfs_client->rpc_ops); | ||
1367 | BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); | ||
1368 | |||
1369 | spin_lock(&nfs_client_lock); | 1361 | spin_lock(&nfs_client_lock); |
1370 | list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks); | 1362 | list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks); |
1371 | list_add_tail(&server->master_link, &nfs_volume_list); | 1363 | list_add_tail(&server->master_link, &nfs_volume_list); |