]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
netfilter: ipset: Suppress false sparse warnings
authorJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 12 Feb 2024 11:51:17 +0000 (12:51 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 12 Feb 2024 11:51:17 +0000 (12:51 +0100)
Due to the code reorganization the functions in question now run by call_rcu(),
not under rcu locking and pointer access. This produces false sparse warning
which are suppressed by the patch.

Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
kernel/net/netfilter/ipset/ip_set_hash_gen.h

index cbb2427952fe6ac178883199b5a19f26b4184046..76c3894e58294cea64107729bf074bf43a223ea0 100644 (file)
@@ -432,7 +432,7 @@ mtype_ahash_destroy(struct ip_set *set, struct htable *t, bool ext_destroy)
        u32 i;
 
        for (i = 0; i < jhash_size(t->htable_bits); i++) {
-               n = hbucket(t, i);
+               n = (__force struct hbucket *)hbucket(t, i);
                if (!n)
                        continue;
                if (set->extensions & IPSET_EXT_DESTROY && ext_destroy)
@@ -452,7 +452,7 @@ mtype_destroy(struct ip_set *set)
        struct htype *h = set->data;
        struct list_head *l, *lt;
 
-       mtype_ahash_destroy(set, h->table, true);
+       mtype_ahash_destroy(set, (__force struct htable *)h->table, true);
        list_for_each_safe(l, lt, &h->ad) {
                list_del(l);
                kfree(l);