Skip to content

Commit 2317dc2

Browse files
tobluxborkmann
authored andcommitted
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 <thorsten.blum@toblux.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20240529101900.103913-2-thorsten.blum@toblux.com
1 parent 7d0b395 commit 2317dc2

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

kernel/bpf/devmap.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,6 @@ int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb,
760760
for (i = 0; i < dtab->n_buckets; i++) {
761761
head = dev_map_index_hash(dtab, i);
762762
hlist_for_each_entry_safe(dst, next, head, index_hlist) {
763-
if (!dst)
764-
continue;
765-
766763
if (is_ifindex_excluded(excluded_devices, num_excluded,
767764
dst->dev->ifindex))
768765
continue;

0 commit comments

Comments
 (0)