summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2017-02-18 14:02:30 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-23 07:14:33 -0500
commitb584c068c6526853f82ccd2a406c3596d7d56be0 (patch)
tree1286f0ae23df7c54a19261bbdecad55e19dfce43 /xlators/cluster/dht/src/dht-common.c
parentafe3a0d2869b706a3d5257f39d6acb9cbe856b87 (diff)
libglusterfs, dht, locks, glusterd: Coverity fixes
Fix up use after free bugs and dead code Change-Id: I8f79ed6b5108926c1fac31c147b5ecba79d10785 BUG: 1424905 Signed-off-by: Nigel Babu <nigelb@redhat.com> Reviewed-on: https://review.gluster.org/16666 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6a061641fd0..c9889514762 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2474,6 +2474,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
dht_layout_t *layout = NULL;
int i = 0;
int call_cnt = 0;
+ int gen = 0;
loc_t new_loc = {0,};
VALIDATE_OR_GOTO (frame, err);
@@ -2548,6 +2549,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"incomplete layout failure for path=%s",
loc->path);
+ gen = layout->gen;
dht_layout_unref (this, local->layout);
local->layout = NULL;
local->cached_subvol = NULL;
@@ -2556,7 +2558,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"Called revalidate lookup for %s, "
"but layout->gen (%d) is less than "
"conf->gen (%d), calling fresh_lookup",
- loc->path, layout->gen, conf->gen);
+ loc->path, gen, conf->gen);
goto do_fresh_lookup;
}