* [PATCH] netfilter: nf_tables: fix error code in nf_tables_updobj()
@ 2022-02-24 15:01 Dan Carpenter
2022-02-24 15:08 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-02-24 15:01 UTC (permalink / raw)
To: Pablo Neira Ayuso, Florian Westphal
Cc: Jozsef Kadlecsik, David S. Miller, Jakub Kicinski,
netfilter-devel, coreteam, netdev, kernel-janitors
Set the error code to -ENOMEM instead of leaving it uninitialized.
Fixes: 33170d18fd2c ("netfilter: nf_tables: fix memory leak during stateful obj update")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This presumably goes through the netfilter tree.
net/netfilter/nf_tables_api.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 49060f281342..d0d2339e7c89 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -6558,8 +6558,10 @@ static int nf_tables_updobj(const struct nft_ctx *ctx,
trans = nft_trans_alloc(ctx, NFT_MSG_NEWOBJ,
sizeof(struct nft_trans_obj));
- if (!trans)
+ if (!trans) {
+ err = -ENOMEM;
goto err_trans;
+ }
newobj = nft_obj_init(ctx, type, attr);
if (IS_ERR(newobj)) {
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] netfilter: nf_tables: fix error code in nf_tables_updobj()
2022-02-24 15:01 [PATCH] netfilter: nf_tables: fix error code in nf_tables_updobj() Dan Carpenter
@ 2022-02-24 15:08 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2022-02-24 15:08 UTC (permalink / raw)
To: Dan Carpenter
Cc: Pablo Neira Ayuso, Florian Westphal, Jozsef Kadlecsik,
David S. Miller, Jakub Kicinski, netfilter-devel, coreteam,
netdev, kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Set the error code to -ENOMEM instead of leaving it uninitialized.
>
> Fixes: 33170d18fd2c ("netfilter: nf_tables: fix memory leak during stateful obj update")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Correct, but this commit no longer exists, it was replaced by
dad3bdeef45f81a6e90204bcc85360bb76eccec7,
"netfilter: nf_tables: fix memory leak during stateful obj update"
... which sets err to -ENOMEM.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-24 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-24 15:01 [PATCH] netfilter: nf_tables: fix error code in nf_tables_updobj() Dan Carpenter
2022-02-24 15:08 ` Florian Westphal
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).