summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nlm4.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server/src/nlm4.c')
-rw-r--r--xlators/nfs/server/src/nlm4.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index ef65d7f55f8..577e8543966 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -1011,7 +1011,8 @@ nlm4_establish_callback(nfs3_call_state_t *cs, call_frame_t *cbk_frame)
int port = -1;
struct nlm4_notify_args *ncf = NULL;
- glusterfs_this_set(cs->nfsx);
+ GF_ASSERT(cs->nfsx);
+ THIS = cs->nfsx;
rpc_transport_get_peeraddr(cs->trans, NULL, 0, &sock_union.storage,
sizeof(sock_union.storage));
@@ -1054,6 +1055,12 @@ nlm4_establish_callback(nfs3_call_state_t *cs, call_frame_t *cbk_frame)
}
options = dict_new();
+ if (options == NULL) {
+ gf_msg(GF_NLM, GF_LOG_ERROR, ENOMEM, NFS_MSG_GFID_DICT_CREATE_FAIL,
+ "dict allocation failed");
+ goto err;
+ }
+
ret = dict_set_str(options, "transport-type", "socket");
if (ret == -1) {
gf_msg(GF_NLM, GF_LOG_ERROR, errno, NFS_MSG_DICT_SET_FAILED,
@@ -2592,6 +2599,11 @@ nlm4svc_init(xlator_t *nfsx)
nlm4prog.private = ns;
options = dict_new();
+ if (options == NULL) {
+ gf_msg(GF_NLM, GF_LOG_ERROR, ENOMEM, NFS_MSG_GFID_DICT_CREATE_FAIL,
+ "dict allocation failed");
+ goto err;
+ }
ret = gf_asprintf(&portstr, "%d", GF_NLM4_PORT);
if (ret == -1)
@@ -2633,7 +2645,6 @@ nlm4svc_init(xlator_t *nfsx)
if (ret == -1) {
gf_msg(GF_NLM, GF_LOG_ERROR, errno, NFS_MSG_LISTENERS_CREATE_FAIL,
"Unable to create listeners");
- dict_unref(options);
goto err;
}
INIT_LIST_HEAD(&nlm_client_list);
@@ -2704,7 +2715,7 @@ nlm4svc_init(xlator_t *nfsx)
goto err;
}
- (void)gf_thread_create(&thr, NULL, nsm_thread, (void *)NULL, "nfsnsm");
+ (void)gf_thread_create(&thr, NULL, nsm_thread, nfsx, "nfsnsm");
timeout.tv_sec = nlm_grace_period;
timeout.tv_nsec = 0;