netfilter: nf_tables: make sure err is initialised to sane value
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: nf_tables: make sure err is initialised to sane value
All warnings (new ones prefixed by >>):
net/netfilter/nf_tables_api.c:6561:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true
Fixes 33170d18fd2c ("netfilter: nf_tables: fix memory leak during stateful obj update")
Reported-by kernel test robot <[email protected]>
Signed-off-by Florian Westphal <[email protected]>
---
For some reason gcc 11.2 doesn't emit such a warning.
net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
@@ -6551,7 +6551,7 @@ static int nf_tables_updobj(const struct nft_ctx *ctx, {struct nft_object *newobj;struct nft_trans *trans; -int err; +int err = -ENOMEM ;if (!try_module_get (type->owner))return -ENOENT ;
Signature · 1 line
2.34.1
Pablo Neira Ayuso
maintainerQuoted 3 lines · Florian Westphal
All warnings (new ones prefixed by >>):
net/netfilter/nf_tables_api.c:6561:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true
I have collapsed this to the original patch, thanks!