summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-tier.c
diff options
context:
space:
mode:
authorhari gowtham <hgowtham@redhat.com>2017-11-02 17:23:05 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-11-17 10:31:03 +0000
commitd1d9a03a06bead6d62becb1e563765222fbcb1bb (patch)
treefdf6b13f23744b69241ae8938b86a56c1360a3d2 /xlators/mgmt/glusterd/src/glusterd-tier.c
parent1d18ec3f04d1e27309471daadea345cf25534b5e (diff)
tier/glusterd: coverity issues in glusterd-tier.c
Coverity issues fixed in this patch: 254, 256, 295, 791, 546 from: https://download.gluster.org/pub/gluster/glusterfs/static-analysis/ master/glusterfs-coverity/2017-10-30-9aa574a5/html/ Change-Id: I44b7d307a3434040125d8b1d6fb18221f30f678d BUG: 789278 Signed-off-by: hari gowtham <hgowtham@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-tier.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-tier.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-tier.c b/xlators/mgmt/glusterd/src/glusterd-tier.c
index 45f6ac30ba3..f9a1d35803d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-tier.c
+++ b/xlators/mgmt/glusterd/src/glusterd-tier.c
@@ -499,6 +499,12 @@ glusterd_op_remove_tier_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
ret = dict_set_str (rsp_dict,
GF_REMOVE_BRICK_TID_KEY,
task_id_str);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ GD_MSG_DICT_SET_FAILED,
+ "failed to set remove-brick-id"
+ "in the dict");
+ }
gf_uuid_parse (task_id_str,
volinfo->tier.rebalance_id);
}
@@ -520,6 +526,7 @@ glusterd_op_remove_tier_brick (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
"migration has failed");
goto out;
}
+ /* Fall through */
case GF_DEFRAG_CMD_DETACH_COMMIT_FORCE:
glusterd_op_perform_detach_tier (volinfo);
@@ -1268,9 +1275,12 @@ out:
if ((rsp.op_errstr) && (strcmp (rsp.op_errstr, "") != 0))
free (rsp.op_errstr);
free (rsp.output.output_val);
- if (req->rpc_status != -1)
+ if (req && (req->rpc_status != -1) && (frame)) {
GLUSTERD_STACK_DESTROY(frame);
- __wake (args);
+ }
+ if (args) {
+ __wake (args);
+ }
return ret;
@@ -1378,7 +1388,7 @@ glusterd_op_tier_status (dict_t *dict, char **op_errstr, dict_t *rsp_dict,
GD_SYNCOP (rpc, (&args), NULL, glusterd_tier_status_cbk, req,
&gd_brick_prog, req->op, xdr_gd1_mgmt_brick_op_req);
- if (req) {
+ if (req != NULL) {
GF_FREE (req);
req = NULL;
}