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>
This commit is contained in:
Susant Palai 2018-09-17 12:18:13 +05:30 committed by Amar Tumballi
parent 48a06e0eaf
commit 607b917475
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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;