On Sat, Jan 11, 2025 at 2:55 AM Ariel Otilibili <ariel.otilibili-anieli@xxxxxxxxxx> wrote: > > b gets assigned a value, but is overwritten before being used. > > Coverity IDs: 1497121, 1496886 > Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map") > Fixes: d6c4503cc296 ("bpf: Implement bpf iterator for hash maps") > Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@xxxxxxxxxx> > --- > kernel/bpf/hashtab.c | 1 - > net/core/bpf_sk_storage.c | 1 - > 2 files changed, 2 deletions(-) > > diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c > index 40095dda891d..23b457536105 100644 > --- a/kernel/bpf/hashtab.c > +++ b/kernel/bpf/hashtab.c > @@ -2039,7 +2039,6 @@ bpf_hash_map_seq_find_next(struct bpf_iter_seq_hash_map_info *info, > return elem; > > /* not found, unlock and go to the next bucket */ > - b = &htab->buckets[bucket_id++]; > rcu_read_unlock(); > skip_elems = 0; > } > diff --git a/net/core/bpf_sk_storage.c b/net/core/bpf_sk_storage.c > index 7d41cde1bcca..7c1b79dcd996 100644 > --- a/net/core/bpf_sk_storage.c > +++ b/net/core/bpf_sk_storage.c > @@ -729,7 +729,6 @@ bpf_sk_storage_map_seq_find_next(struct bpf_iter_seq_sk_storage_map_info *info, > struct bpf_local_storage_elem, map_node); > if (!selem) { > /* not found, unlock and go to the next bucket */ > - b = &smap->buckets[bucket_id++]; 'b' is reassigned indeed, but the patch is broken. Look at the line you're deleting more carefully. And run selftests before posting patches. Error: #19 bpf_iter Error: #19/26 bpf_iter/bpf_percpu_hash_map Error: #19/30 bpf_iter/bpf_sk_storage_map pw-bot: cr