Change in libosmo-sccp[master]: osmo_ss7_instance_destroy: use for_each_entry_safe

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 22 14:26:17 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/26665 )

Change subject: osmo_ss7_instance_destroy: use for_each_entry_safe
......................................................................

osmo_ss7_instance_destroy: use for_each_entry_safe

Fix segfault in each loop.

Change-Id: Ieaec3584375b0e6b943638fe1e50b4d74a627216
---
M src/osmo_ss7.c
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 649e3f7..99536d3 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -410,20 +410,20 @@
  *  \param[in] inst SS7 Instance to be destroyed */
 void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
 {
-	struct osmo_ss7_linkset *lset;
-	struct osmo_ss7_as *as;
-	struct osmo_ss7_asp *asp;
+	struct osmo_ss7_linkset *lset, *lset2;
+	struct osmo_ss7_as *as, *as2;
+	struct osmo_ss7_asp *asp, *asp2;
 
 	OSMO_ASSERT(ss7_initialized);
 	LOGSS7(inst, LOGL_INFO, "Destroying SS7 Instance\n");
 
-	llist_for_each_entry(asp, &inst->asp_list, list)
+	llist_for_each_entry_safe(asp, asp2, &inst->asp_list, list)
 		osmo_ss7_asp_destroy(asp);
 
-	llist_for_each_entry(as, &inst->as_list, list)
+	llist_for_each_entry_safe(as, as2, &inst->as_list, list)
 		osmo_ss7_as_destroy(as);
 
-	llist_for_each_entry(lset, &inst->linksets, list)
+	llist_for_each_entry_safe(lset, lset2, &inst->linksets, list)
 		osmo_ss7_linkset_destroy(lset);
 
 	llist_del(&inst->list);

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/26665
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ieaec3584375b0e6b943638fe1e50b4d74a627216
Gerrit-Change-Number: 26665
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211222/6a6dc999/attachment.htm>


More information about the gerrit-log mailing list