summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-linkfile.c
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-06-04 16:43:35 +0530
committerAnand Avati <avati@redhat.com>2013-06-04 13:27:48 -0700
commitdbfe779f3049e6fbc2394bdacdb57165d51dc3f3 (patch)
tree568ab673ca0a7542ecd3629714b48b7ee5d681e7 /xlators/cluster/dht/src/dht-linkfile.c
parent0c1916f3e1eb81aa81dc2d62e97f46880390838c (diff)
cluster/dht: Prevent crash in dht_linkfile_lookup
Assign local = frame->local before dereferencing local->linkfile.linkfile_cbk. Additionally, fail if op_ret is non_zero. Change-Id: I96a2f34ba29887da9ccaae38a644431cf7c43265 BUG: 966858 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.org/5141 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-linkfile.c')
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 13d791a8ff6..39d72ae6351 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -30,13 +30,13 @@ dht_linkfile_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
dht_local_t *local = NULL;
call_frame_t *prev = NULL;
- if (!op_ret)
- goto out;
-
local = frame->local;
prev = cookie;
conf = this->private;
+ if (op_ret)
+ goto out;
+
is_linkfile = check_is_linkfile (inode, stbuf, xattr,
conf->link_xattr_name);
if (!is_linkfile)