From f6ab03d27cf394f8429b4c77cef0602547f6fd67 Mon Sep 17 00:00:00 2001 From: Subha sree Mohankumar Date: Sat, 11 Nov 2017 01:12:02 +0530 Subject: libglusterfs/gfdb:coverity issue fix Coverity Id:719,748,761 problem : The value of "ret" is overwritten in init_db and add_conection_node Change-Id: Iade8ca8d61c5e25e8c311b1375219f5f61d51bc3 BUG: 789278 Signed-off-by: Subha sree Mohankumar --- libglusterfs/src/gfdb/gfdb_data_store.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libglusterfs/src/gfdb/gfdb_data_store.c') diff --git a/libglusterfs/src/gfdb/gfdb_data_store.c b/libglusterfs/src/gfdb/gfdb_data_store.c index 7074c4a51c2..8ba7606012a 100644 --- a/libglusterfs/src/gfdb/gfdb_data_store.c +++ b/libglusterfs/src/gfdb/gfdb_data_store.c @@ -111,6 +111,7 @@ add_connection_node (gfdb_conn_node_t *_conn_node) { LG_MSG_UNLOCK_LIST_FAILED, "Failed unlock db " "connection list %s", strerror(ret)); ret = -1; + goto out; /*TODO What if the unlock fails. * Will it lead to deadlock? * Most of the gluster code @@ -261,7 +262,6 @@ init_db (dict_t *args, gfdb_db_type_t gfdb_db_type) gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0, LG_MSG_INIT_DB_FAILED, "Failed initializing database " "operation failed."); - ret = -1; goto init_db_failed; } @@ -272,7 +272,6 @@ init_db (dict_t *args, gfdb_db_type_t gfdb_db_type) if (ret) { gf_msg (GFDB_DATA_STORE, GF_LOG_ERROR, 0, LG_MSG_INIT_DB_FAILED, "Failed initializing database"); - ret = -1; goto init_db_failed; } _conn_node->gfdb_connection.gfdb_db_type = gfdb_db_type; -- cgit