summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server
diff options
context:
space:
mode:
authorShwetha Acharya <sacharya@redhat.com>2018-09-18 15:40:29 +0530
committerAmar Tumballi <amarts@redhat.com>2018-09-21 05:16:32 +0000
commitbbcec1a1caf95aad581083e7131feda04295f299 (patch)
tree590c77f38c3733163e9463ed0b10ff6eacaf42d6 /xlators/nfs/server
parent2fd9d62691056b9f0601dbc2bf6f42626b015d07 (diff)
nfs/server: NULL pointer dereferencing clang fix
Added some condition checks in nfs3.c and nlm4.c Updates: bz#1622665 Change-Id: Ia10b8fff14f651df1360c9bb79d4476b282f54b5 Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r--xlators/nfs/server/src/nfs3.c2
-rw-r--r--xlators/nfs/server/src/nlm4.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 42799bd..eaae4eb 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -771,7 +771,7 @@ nfs3_request_xlator_deviceid(rpcsvc_request_t *rq)
xl = rpcsvc_request_private(rq);
nfs3 = rpcsvc_request_program_private(rq);
- if (gf_nfs_dvm_off(nfs_state(nfs3->nfsx)))
+ if (nfs3 && (gf_nfs_dvm_off(nfs_state(nfs3->nfsx))))
devid = (uint64_t)nfs_xlator_to_xlid(nfs3->exportslist, xl);
else {
__nfs3_get_volume_id(nfs3, xl, volumeid);
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index 0989f47..873f350 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -767,7 +767,7 @@ nlm4_test_reply(nfs3_call_state_t *cs, nlm4_stats stat, struct gf_flock *flock)
memset(&res, 0, sizeof(res));
res.cookie = cs->args.nlm4_testargs.cookie;
res.stat.stat = stat;
- if (stat == nlm4_denied)
+ if ((stat == nlm4_denied) && flock)
nlm4_gf_flock_to_holder(&res.stat.nlm4_testrply_u.holder, flock);
nlm4svc_submit_reply(cs->req, (void *)&res,