]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netfilter: nf_tables: remove annotation to access set timeout while holding lock
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 2 Sep 2024 23:07:06 +0000 (01:07 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 3 Sep 2024 16:18:31 +0000 (18:18 +0200)
Mutex is held when adding an element, no need for READ_ONCE, remove it.

Fixes: 123b99619cca ("netfilter: nf_tables: honor set timeout and garbage collection updates")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index 6c0c6f8a08a830a470a1c172688043b0e80188ae..571aa30918e9bb5fb1357a2c73066ea14637faa7 100644 (file)
@@ -6916,7 +6916,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
                        return err;
        } else if (set->flags & NFT_SET_TIMEOUT &&
                   !(flags & NFT_SET_ELEM_INTERVAL_END)) {
-               timeout = READ_ONCE(set->timeout);
+               timeout = set->timeout;
        }
 
        expiration = 0;
@@ -7023,7 +7023,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
                if (err < 0)
                        goto err_parse_key_end;
 
-               if (timeout != READ_ONCE(set->timeout)) {
+               if (timeout != set->timeout) {
                        err = nft_set_ext_add(&tmpl, NFT_SET_EXT_TIMEOUT);
                        if (err < 0)
                                goto err_parse_key_end;