Commit 577c734a authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Pablo Neira Ayuso

netfilter: bitwise: replace gotos with returns.

When dumping a bitwise expression, if any of the puts fails, we use goto
to jump to a label.  However, no clean-up is required and the only
statement at the label is a return.  Drop the goto's and return
immediately instead.
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 265ec7b0
...@@ -107,24 +107,21 @@ static int nft_bitwise_dump(struct sk_buff *skb, const struct nft_expr *expr) ...@@ -107,24 +107,21 @@ static int nft_bitwise_dump(struct sk_buff *skb, const struct nft_expr *expr)
const struct nft_bitwise *priv = nft_expr_priv(expr); const struct nft_bitwise *priv = nft_expr_priv(expr);
if (nft_dump_register(skb, NFTA_BITWISE_SREG, priv->sreg)) if (nft_dump_register(skb, NFTA_BITWISE_SREG, priv->sreg))
goto nla_put_failure; return -1;
if (nft_dump_register(skb, NFTA_BITWISE_DREG, priv->dreg)) if (nft_dump_register(skb, NFTA_BITWISE_DREG, priv->dreg))
goto nla_put_failure; return -1;
if (nla_put_be32(skb, NFTA_BITWISE_LEN, htonl(priv->len))) if (nla_put_be32(skb, NFTA_BITWISE_LEN, htonl(priv->len)))
goto nla_put_failure; return -1;
if (nft_data_dump(skb, NFTA_BITWISE_MASK, &priv->mask, if (nft_data_dump(skb, NFTA_BITWISE_MASK, &priv->mask,
NFT_DATA_VALUE, priv->len) < 0) NFT_DATA_VALUE, priv->len) < 0)
goto nla_put_failure; return -1;
if (nft_data_dump(skb, NFTA_BITWISE_XOR, &priv->xor, if (nft_data_dump(skb, NFTA_BITWISE_XOR, &priv->xor,
NFT_DATA_VALUE, priv->len) < 0) NFT_DATA_VALUE, priv->len) < 0)
goto nla_put_failure; return -1;
return 0; return 0;
nla_put_failure:
return -1;
} }
static struct nft_data zero; static struct nft_data zero;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment