From 05d3dfb9623f0939fa807cce3b9336a09fadab2a Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 8 Jan 2015 08:35:33 +0000 Subject: 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 Reviewed-on: http://review.gluster.org/9416 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-syncop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src') 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 */ -- cgit