From: Thorsten Blum Date: Wed, 29 May 2024 10:19:01 +0000 (+0200) Subject: bpf, devmap: Remove unnecessary if check in for loop X-Git-Tag: v6.10-rc3~27^2~6^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2317dc2c22cc353b699c7d1db47b2fe91f54055c;p=thirdparty%2Fkernel%2Flinux.git bpf, devmap: Remove unnecessary if check in for loop The iterator variable dst cannot be NULL and the if check can be removed. Remove it and fix the following Coccinelle/coccicheck warning reported by itnull.cocci: ERROR: iterator variable bound on line 762 cannot be NULL Signed-off-by: Thorsten Blum Signed-off-by: Daniel Borkmann Reviewed-by: Toke Høiland-Jørgensen Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20240529101900.103913-2-thorsten.blum@toblux.com --- diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 4e2cdbb5629f2..7f3b34452243c 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -760,9 +760,6 @@ int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb, for (i = 0; i < dtab->n_buckets; i++) { head = dev_map_index_hash(dtab, i); hlist_for_each_entry_safe(dst, next, head, index_hlist) { - if (!dst) - continue; - if (is_ifindex_excluded(excluded_devices, num_excluded, dst->dev->ifindex)) continue;