[PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info

Subsystems: networking [general], the rest

STALE1829d LANDED

Landed in mainline as bebc3bbf5131 on 2021-08-03.

3 messages, 3 authors, 2021-08-03 · open the first message on its own page

[PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info

From: Yajun Deng <hidden>
Date: 2021-08-03 07:37:58

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 <redacted>
---
 net/decnet/dn_fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 387a7e81dd00..153a5fc1bdde 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -389,7 +389,7 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct nlattr *att
 		return 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;
-- 
2.32.0

Re: [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info

From: David Ahern <hidden>
Date: 2021-08-03 14:43:49

On 8/3/21 1:37 AM, Yajun Deng wrote:
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 <redacted>
---
 net/decnet/dn_fib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: David Ahern <dsahern@kernel.org>

Re: [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-08-03 21:30:14

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue,  3 Aug 2021 15:37:39 +0800 you wrote:
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 <redacted>
---
 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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help