diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-09-04 19:46:48 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-09-10 22:55:58 -0700 |
commit | 32c5e17d3b04c34cc4349db897c4c5c8a07233c6 (patch) | |
tree | b55a0af42042ae2892a139e396173b99da2e0ef7 /xlators/cluster/dht/src/dht-common.c | |
parent | 0628c77f9069e93c49993722ac577becfcf902db (diff) |
dht: NULL dereferencing causes crash
If linkfile_create is failed for some reason, then
we are trying to dereference a null variable
backport of http://review.gluster.org/#/c/12106/
>Change-Id: I3c6ff3715821b9b993d1bab7b90167de2861e190
>BUG: 1260147
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Change-Id: I7fd98dc298ffe5aab07df10c3b28d0736cb25653
BUG: 1260511
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/12112
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f5de8e6a6ad..9a8a161bd17 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -5041,10 +5041,10 @@ dht_mknod_linkfile_create_cbk (call_frame_t *frame, void *cookie, dht_local_t *local = NULL; xlator_t *cached_subvol = NULL; + local = frame->local; if (op_ret == -1) goto err; - local = frame->local; if (!local || !local->cached_subvol) { op_errno = EINVAL; goto err; @@ -5839,12 +5839,12 @@ dht_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, dht_local_t *local = NULL; xlator_t *cached_subvol = NULL; + local = frame->local; if (op_ret == -1) { local->op_errno = op_errno; goto err; } - local = frame->local; cached_subvol = local->cached_subvol; STACK_WIND (frame, dht_create_cbk, |