summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nlm4.c
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/src/nlm4.c
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/src/nlm4.c')
-rw-r--r--xlators/nfs/server/src/nlm4.c2
1 files changed, 1 insertions, 1 deletions
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,