From: Fernando Fernandez Mancera <ffmancera@riseup.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>,
Florian Westphal <fw@strlen.de>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] netfilter: nf_tables: Fix an Oops in nf_tables_updobj() error handling
Date: Fri, 6 Sep 2019 10:36:49 +0200 [thread overview]
Message-ID: <efae8f44-224e-9337-64cf-47fd67ba2950@riseup.net> (raw)
In-Reply-To: <20190906081808.GA8281@mwanda>
Oh sorry, I missed that. Thanks!
Acked-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
On 9/6/19 10:18 AM, Dan Carpenter wrote:
> The "newobj" is an error pointer so we can't pass it to kfree(). It
> doesn't need to be freed so we can remove that and I also renamed the
> error label.
>
> Fixes: d62d0ba97b58 ("netfilter: nf_tables: Introduce stateful object update operation")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> net/netfilter/nf_tables_api.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index cf767bc58e18..6f66898d63b4 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -5148,7 +5148,7 @@ static int nf_tables_updobj(const struct nft_ctx *ctx,
> newobj = nft_obj_init(ctx, type, attr);
> if (IS_ERR(newobj)) {
> err = PTR_ERR(newobj);
> - goto err1;
> + goto err_free_trans;
> }
>
> nft_trans_obj(trans) = obj;
> @@ -5157,9 +5157,9 @@ static int nf_tables_updobj(const struct nft_ctx *ctx,
> list_add_tail(&trans->list, &ctx->net->nft.commit_list);
>
> return 0;
> -err1:
> +
> +err_free_trans:
> kfree(trans);
> - kfree(newobj);
> return err;
> }
>
>
next prev parent reply other threads:[~2019-09-06 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 8:18 [PATCH] netfilter: nf_tables: Fix an Oops in nf_tables_updobj() error handling Dan Carpenter
2019-09-06 8:36 ` Fernando Fernandez Mancera [this message]
2019-09-08 16:11 ` Pablo Neira Ayuso
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efae8f44-224e-9337-64cf-47fd67ba2950@riseup.net \
--to=ffmancera@riseup.net \
--cc=coreteam@netfilter.org \
--cc=dan.carpenter@oracle.com \
--cc=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).