From 607b91747574bb912477df5dd11c4e31cde4c0bf Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Mon, 17 Sep 2018 12:18:13 +0530 Subject: 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 --- xlators/cluster/dht/src/dht-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/dht-common.c') 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); -- cgit