Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b74ae961 authored by Dan Carpenter's avatar Dan Carpenter Committed by Pablo Neira Ayuso
Browse files

netfilter: nf_tables: Fix an Oops in nf_tables_updobj() error handling



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: d62d0ba9 ("netfilter: nf_tables: Introduce stateful object update operation")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarFernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 6703a605
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5151,7 +5151,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;
@@ -5160,9 +5160,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;
}