diff options
| author | Atin Mukherjee <amukherj@redhat.com> | 2019-04-24 22:02:51 +0530 |
|---|---|---|
| committer | Atin Mukherjee <amukherj@redhat.com> | 2019-04-25 06:39:16 +0000 |
| commit | c827682e4df44ec6aaae3780c325568fb43053ff (patch) | |
| tree | ac7ddc6c908f18f9c163dbd19302d6274b7111d3 /xlators/mgmt/glusterd/src/glusterd-syncop.c | |
| parent | 647e2d3a9fbe36f2fbf062feda53b7cb6aa4830b (diff) | |
glusterd: coverity fixes
Addresses the following:
* CID 1124776: Resource leaks (RESOURCE_LEAK) - Variable "aa" going out
of scope leaks the storage it points to in glusterd-volgen.c
* Bunch of CHECKED_RETURN defects in the callers of synctask_barrier_init
* CID 1400755: Error handling issues (CHECKED_RETURN) - Calling
"gf_is_service_running" without checking return value in
xlators/mgmt/glusterd/src/glusterd-shd-svc.c: 671 in
glusterd_shdsvc_stop()
* CID 1400745: Memory - illegal accesses (USE_AFTER_FREE) - Dereferencing
freed pointer "volinfo" in /xlators/mgmt/glusterd/src/glusterd-shd-svc.c: 460 in glusterd_shdsvc_start()
* CID 1400742: Program hangs (LOCK) - adding annotation to fix this
false positive
Updates: bz#789278
Change-Id: I02f16e7eeb8c5cf72f7d0b29d00df4f03b3718b3
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 9bab2cfd54c..60a25ad974a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -1191,7 +1191,12 @@ gd_lock_op_phase(glusterd_conf_t *conf, glusterd_op_t op, dict_t *op_ctx, struct syncargs args = {0}; this = THIS; - synctask_barrier_init((&args)); + GF_VALIDATE_OR_GOTO("glusterd", this, out); + + ret = synctask_barrier_init((&args)); + if (ret) + goto out; + peer_cnt = 0; RCU_READ_LOCK; @@ -1321,7 +1326,10 @@ stage_done: } gd_syncargs_init(&args, aggr_dict); - synctask_barrier_init((&args)); + ret = synctask_barrier_init((&args)); + if (ret) + goto out; + peer_cnt = 0; RCU_READ_LOCK; @@ -1449,7 +1457,10 @@ commit_done: } gd_syncargs_init(&args, op_ctx); - synctask_barrier_init((&args)); + ret = synctask_barrier_init((&args)); + if (ret) + goto out; + peer_cnt = 0; origin_glusterd = is_origin_glusterd(req_dict); @@ -1541,7 +1552,10 @@ gd_unlock_op_phase(glusterd_conf_t *conf, glusterd_op_t op, int *op_ret, goto out; } - synctask_barrier_init((&args)); + ret = synctask_barrier_init((&args)); + if (ret) + goto out; + peer_cnt = 0; if (cluster_lock) { |
