netfilter: nf_tables: adjust lockdep assertions handling
authorFedor Pchelkin <pchelkin@ispras.ru>
Tue, 24 Jun 2025 11:12:15 +0000 (14:12 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 10 Jul 2025 01:01:22 +0000 (03:01 +0200)
commit8df1b40de76979bb8e975201d07b71103d5de820
treeb7c8aede44ceb259cbf7ae66bc1154bfb2e45eaf
parenta1050dd071682d2c9d8d6d5c96119f8f401b62f0
netfilter: nf_tables: adjust lockdep assertions handling

It's needed to check the return value of lockdep_commit_lock_is_held(),
otherwise there's no point in this assertion as it doesn't print any
debug information on itself.

Found by Linux Verification Center (linuxtesting.org) with Svace static
analysis tool.

Fixes: b04df3da1b5c ("netfilter: nf_tables: do not defer rule destruction via call_rcu")
Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c