]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
netfilter: bitwise: improve error goto labels
authorJeremy Sowden <jeremy@azazel.net>
Mon, 4 Apr 2022 12:04:15 +0000 (13:04 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:57:46 +0000 (11:57 +0200)
BugLink: https://bugs.launchpad.net/bugs/1991717
[ Upstream commit 00bd435208e5201eb935d273052930bd3b272b6f ]

Replace two labels (`err1` and `err2`) with more informative ones.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/netfilter/nft_bitwise.c

index 47b0dba95054f0877037a392503e89ced02201a8..d0c648b64cd4076c0c17d804835e2377ab6519d7 100644 (file)
@@ -109,22 +109,23 @@ static int nft_bitwise_init_bool(struct nft_bitwise *priv,
                return err;
        if (mask.type != NFT_DATA_VALUE || mask.len != priv->len) {
                err = -EINVAL;
-               goto err1;
+               goto err_mask_release;
        }
 
        err = nft_data_init(NULL, &priv->xor, sizeof(priv->xor), &xor,
                            tb[NFTA_BITWISE_XOR]);
        if (err < 0)
-               goto err1;
+               goto err_mask_release;
        if (xor.type != NFT_DATA_VALUE || xor.len != priv->len) {
                err = -EINVAL;
-               goto err2;
+               goto err_xor_release;
        }
 
        return 0;
-err2:
+
+err_xor_release:
        nft_data_release(&priv->xor, xor.type);
-err1:
+err_mask_release:
        nft_data_release(&priv->mask, mask.type);
        return err;
 }