diff options
author | Susant Palai <spalai@redhat.com> | 2018-09-17 12:18:13 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-09-24 18:07:39 +0000 |
commit | 607b91747574bb912477df5dd11c4e31cde4c0bf (patch) | |
tree | 2eb13fe56f7ff5cf5cbd96f684491de9e4c10f5a /xlators | |
parent | 48a06e0eaff8b613c3e05d8168e8faff838b727f (diff) |
dht: Coverity fixes
CID: 1274236 Issue: Logically dead code (op_errno will never be -1)
CID: 1351652 Issue: Dereference after null check.
(local->fd is dereferenced anyway and it should not be NULL ever for
dht_readdirp_cbk.)
Change-Id: Ied9c5f5b72536be1ca944237165acdc62b792e58
updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 4 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 4ca54a1f5c0..c5d75d4153c 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6576,7 +6576,9 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, prev = cookie; local = frame->local; - itable = local->fd ? local->fd->inode->table : NULL; + GF_VALIDATE_OR_GOTO(this->name, local->fd, unwind); + + itable = local->fd->inode->table; conf = this->private; GF_VALIDATE_OR_GOTO(this->name, conf, unwind); diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index 57a1a9f8b0c..ed4625c5f94 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -578,7 +578,6 @@ dht_rename_dir(call_frame_t *frame, xlator_t *this) return 0; err: - op_errno = (op_errno == -1) ? errno : op_errno; DHT_STACK_UNWIND(rename, frame, -1, op_errno, NULL, NULL, NULL, NULL, NULL, NULL); return 0; |