pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/40628?usp=email )

Change subject: osmux: Use while loop to tear down entire llist
......................................................................

osmux: Use while loop to tear down entire llist

There's no need to use more complex llist_for_each_entry_safe() here.

Related: SYS#7508
Change-Id: Id98619b1e91f12b0febf40118113bb53bd526702
---
M src/osmux_input.c
1 file changed, 4 insertions(+), 4 deletions(-)

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




diff --git a/src/osmux_input.c b/src/osmux_input.c
index 2184a08..41f12b6 100644
--- a/src/osmux_input.c
+++ b/src/osmux_input.c
@@ -144,8 +144,8 @@

 static void osmux_circuit_del_msgs(struct osmux_link *link, struct 
osmux_circuit *circuit)
 {
-       struct msgb *cur, *tmp;
-       llist_for_each_entry_safe(cur, tmp, &circuit->msg_list, list) {
+       struct msgb *cur;
+       while ((cur = llist_first_entry_or_null(&circuit->msg_list, struct 
msgb, list))) {
                osmux_circuit_dequeue(circuit, cur);
                msgb_free(cur);
                link->nmsgs--;
@@ -687,9 +687,9 @@
 static int osmux_xfrm_input_talloc_destructor(struct osmux_in_handle *h)
 {
        struct osmux_link *link = (struct osmux_link *)h->internal_data;
-       struct osmux_circuit *circuit, *next;
+       struct osmux_circuit *circuit;

-       llist_for_each_entry_safe(circuit, next, &link->circuit_list, head)
+       while ((circuit = llist_first_entry_or_null(&link->circuit_list, struct 
osmux_circuit, head)))
                osmux_link_del_circuit(link, circuit);

        osmo_timer_del(&link->timer);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/40628?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id98619b1e91f12b0febf40118113bb53bd526702
Gerrit-Change-Number: 40628
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>

Reply via email to