netfilter: nf_tables: fix error handling of rule replacement

commit 59900e0a01 upstream.

In general, if a transaction object is added to the list successfully,
we can rely on the abort path to undo what we've done. This allows us to
simplify the error handling of the rule replacement path in
nf_tables_newrule().

This implicitly fixes an unnecessary removal of the old rule, which
needs to be left in place if we fail to replace.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
This commit is contained in:
Pablo Neira Ayuso 2015-03-04 17:55:27 +01:00 • committed by Luis Henriques
commit c55a5bde67