bpf, devmap: Remove unnecessary if check in for loop

JIRA: https://issues.redhat.com/browse/RHEL-30773

commit 2317dc2c22cc353b699c7d1db47b2fe91f54055c
Author: Thorsten Blum <thorsten.blum@toblux.com>
Date:   Wed May 29 12:19:01 2024 +0200

    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

Signed-off-by: Viktor Malik <vmalik@redhat.com>
This commit is contained in:
Viktor Malik 2024-10-24 15:38:09 +02:00
parent 6dedf6ccff
commit 109fea232b
No known key found for this signature in database
GPG Key ID: AF7A2E1F6EE74FB3
1 changed files with 0 additions and 3 deletions

View File

@ -750,9 +750,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;