From fd397e59d8856e4d5f1ccbec1baaedb71623951e Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Tue, 31 Oct 2017 11:24:04 +0530 Subject: snapshot: fix coverity issue 'DEADCODE' Problem : Unreachable code at glusterd-snapshot.c:6718 Unreachable code at glusterd-snapshot.c:7352 FIx : Remove unreachable code At glusterd-snapshot.c:6718 in if condition the value of "snap" must be "NULL" to call glusterd_snap_remove() which is not possible here. Change-Id: Id865bde7c1474a9b9ed11c0ed614676b4e2443c6 BUG: 789278 Signed-off-by: Sunny Kumar --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index a8436e31c9f..e8ba32087f6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -6718,9 +6718,6 @@ glusterd_create_snap_object_for_clone (dict_t *dict, dict_t *rsp_dict) out: if (ret) { - if (snap) - glusterd_snap_remove (rsp_dict, snap, - _gf_true, _gf_true, _gf_true); snap = NULL; } @@ -7347,15 +7344,8 @@ glusterd_get_brick_lvm_details (dict_t *rsp_dict, break; token = strtok (buf, ":"); if (token != NULL) { - while (token && token[0] == ' ') + while (token[0] == ' ') token++; - if (!token) { - ret = -1; - gf_msg (this->name, GF_LOG_ERROR, EINVAL, - GD_MSG_INVALID_ENTRY, - "Invalid vg entry"); - goto end; - } value = gf_strdup (token); if (!value) { ret = -1; -- cgit