summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-01-08 08:35:33 +0000
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-01-08 08:49:55 -0800
commit05d3dfb9623f0939fa807cce3b9336a09fadab2a (patch)
tree203994ed45baee3d3929e1ebbed92e7137937b39 /xlators/mgmt
parent4056ed598f642d2d23a65b79495b0247d84db2f4 (diff)
glusterd: use list_for_each_entry_safe for cleanup
Use list_for_each_entry_safe() instead of list_for_each_entry() for cleanup of local xaction_peers list. Change-Id: I6d70c04dfb90cbbcd8d9fc4155b8e5e7d7612460 BUG: 1173414 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/9416 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index 42a8cdcb685..357c0164a6d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1082,14 +1082,15 @@ gd_build_local_xaction_peers_list (struct list_head *peers,
void
gd_cleanup_local_xaction_peers_list (struct list_head *xact_peers)
{
+ glusterd_local_peers_t *local_peers = NULL;
+ glusterd_local_peers_t *tmp = NULL;
+
GF_ASSERT (xact_peers);
if (list_empty (xact_peers))
return;
- glusterd_local_peers_t *local_peers = NULL;
-
- list_for_each_entry (local_peers, xact_peers, op_peers_list) {
+ list_for_each_entry_safe (local_peers, tmp, xact_peers, op_peers_list) {
GF_FREE (local_peers);
/* local_peers->peerinfo need not be freed because it does not
* ownership of peerinfo, but merely refer it */