Since commit 75e072a390da ("bpf, sockmap: Fix update element with same"), using the _safe variant of list_for_each_entry() is unnecessary. Simplify the loop. Signed-off-by: Michal Luczaj <mhal@xxxxxxx> --- net/core/sock_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 82a14f131d00c604f1dfa51e51563aeacda44198..b89d42f7ba702badd5b00c6329e3c9eea8ed4fd3 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -143,10 +143,10 @@ static void sock_map_del_link(struct sock *sk, struct sk_psock *psock, void *link_raw) { bool strp_stop = false, verdict_stop = false; - struct sk_psock_link *link, *tmp; + struct sk_psock_link *link; spin_lock_bh(&psock->link_lock); - list_for_each_entry_safe(link, tmp, &psock->link, list) { + list_for_each_entry(link, &psock->link, list) { if (link->link_raw == link_raw) { struct bpf_map *map = link->map; struct sk_psock_progs *progs = sock_map_progs(map); --- base-commit: 433873f9e6dad71f1d9a0d4966bfe92d26809dbd change-id: 20250212-sockmap-del-link-cleanup-208ca01ba2f7 Best regards, -- Michal Luczaj <mhal@xxxxxxx>