net: decnet: Fix refcount warning for new dn_fib_info
Subsystems (2)
PATCH 1/1 net: decnet: Fix refcount warning for new dn_fib_info
fib_treeref needs to be set after kzalloc. The old code had a ++ which led to the confusion when the int was replaced by a refcount_t.
Fixes 79976892f7ea ("net: convert fib_treeref from int to refcount_t")
Signed-off-by Yajun Deng <[email protected]>
--- net/decnet/dn_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/decnet/dn_fib.c +1 -1
@@ -389,7 +389,7 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct nlattr *attreturn ofi; } -refcount_inc (&fi->fib_treeref); +refcount_set (&fi->fib_treeref,1 );refcount_set (&fi->fib_clntref,1 );spin_lock (&dn_fib_info_lock); fi->fib_next = dn_fib_info_list;
Signature · 1 line
2.32.0
Quoted 9 lines · Yajun Deng
fib_treerefneeds to be set after kzalloc. The old code had a ++ which led to the confusion when the int was replaced by arefcount_t.Fixes 79976892f7ea ("net: convert fib_treeref from int to refcount_t")Signed-off-by Yajun Deng <[email protected]>--- net/decnet/dn_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by David Ahern <[email protected]>
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 8 lines · On Tue, 3 Aug 2021 15:37:39 +0800 you wrote:
fib_treerefneeds to be set after kzalloc. The old code had a ++ which led to the confusion when the int was replaced by arefcount_t.Fixes 79976892f7ea ("net: convert fib_treeref from int to refcount_t")Signed-off-by Yajun Deng <[email protected]>--- net/decnet/dn_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: decnet: Fix refcount warning for new dn_fib_info
https://git.kernel.org/netdev/net-next/c/bebc3bbf5131
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html