diff options
author | Susant Palai <spalai@redhat.com> | 2018-10-03 20:40:12 +0530 |
---|---|---|
committer | N Balachandran <nbalacha@redhat.com> | 2018-10-05 03:24:47 +0000 |
commit | 07cb6a486502fa0f7ea141e7600ec67015383546 (patch) | |
tree | aba6f3d00a9251bb4cb2a61fff896e8d3a3bad7d /xlators/cluster/dht/src/dht-layout.c | |
parent | f87d1a1e3374596bc5ee9dad2aee8d12db657da5 (diff) |
dht: coverity fixes
CID: 1356541 Issue: Dereference null return value
CID: 1382411 Issue: Dereference after null check
CID: 1391409 Issue: Unchecked return value
Change-Id: Id3d4feb4e88df424003cc8e8a1540e77bbe030e3
Updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-layout.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-layout.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 43746bc63b9..544b9638104 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -497,7 +497,7 @@ dht_layout_sort_volname(dht_layout_t *layout) return 0; } -int +void dht_layout_anomalies(xlator_t *this, loc_t *loc, dht_layout_t *layout, uint32_t *holes_p, uint32_t *overlaps_p, uint32_t *missing_p, uint32_t *down_p, uint32_t *misc_p, @@ -510,7 +510,6 @@ dht_layout_anomalies(xlator_t *this, loc_t *loc, dht_layout_t *layout, uint32_t hole_cnt = 0; uint32_t overlap_cnt = 0; int i = 0; - int ret = 0; uint32_t prev_stop = 0; uint32_t last_stop = 0; char is_virgin = 1; @@ -593,8 +592,6 @@ dht_layout_anomalies(xlator_t *this, loc_t *loc, dht_layout_t *layout, if (no_space_p) *no_space_p = no_space; - - return ret; } int @@ -637,14 +634,8 @@ dht_layout_normalize(xlator_t *this, loc_t *loc, dht_layout_t *layout) gf_uuid_unparse(loc->gfid, gfid); - ret = dht_layout_anomalies(this, loc, layout, &holes, &overlaps, &missing, - &down, &misc, NULL); - if (ret == -1) { - gf_msg(this->name, GF_LOG_WARNING, 0, - DHT_MSG_FIND_LAYOUT_ANOMALIES_ERROR, - "Error finding anomalies in %s, gfid = %s", loc->path, gfid); - goto out; - } + dht_layout_anomalies(this, loc, layout, &holes, &overlaps, &missing, &down, + &misc, NULL); if (holes || overlaps) { if (missing == layout->cnt) { |