LKML Archive on
help / color / mirror / Atom feed
From: Lukas Bulwahn <>
To: Pablo Neira Ayuso <>,
	Jozsef Kadlecsik <>,
	Florian Westphal <>,,
	Linux Kernel Mailing List <>,
	Netdev <>,,
	clang-built-linux <>
Subject: Suspicious pattern for use of function xt_register_template()
Date: Mon, 23 Aug 2021 19:01:14 +0200	[thread overview]
Message-ID: <> (raw)

Dear Florian, dear netfilter maintainers,

Commit fdacd57c79b ("netfilter: x_tables: never register tables by
default") on linux-next
introduces the function xt_register_template() and in all cases but
one, the calls to that function are followed by:

    if (ret < 0)
        return ret;

All these checks were also added with the commit above.

In the one case, for iptable_mangle_init() in
./net/ipv4/netfilter/iptable_mangle.c, this pattern was not followed.
This makes this ret assignment in this function a Dead Store and
hence, clang-analyzer warns about that.

Are we missing here an early return for a negative return value as
well, or is this case for iptable_mangle_init() in
./net/ipv4/netfilter/iptable_mangle.c special?

Best regards,


             reply	other threads:[~2021-08-23 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 17:01 Lukas Bulwahn [this message]
2021-08-23 19:10 ` Florian Westphal
2021-08-23 20:28   ` Lukas Bulwahn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \
    --subject='Re: Suspicious pattern for use of function xt_register_template()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).