netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info
@ 2021-08-03  7:37 Yajun Deng
  2021-08-03 14:42 ` David Ahern
  2021-08-03 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yajun Deng @ 2021-08-03  7:37 UTC (permalink / raw)
  To: davem, kuba, dsahern; +Cc: linux-decnet-user, netdev, Yajun Deng

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 <yajun.deng@linux.dev>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info
  2021-08-03  7:37 [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info Yajun Deng
@ 2021-08-03 14:42 ` David Ahern
  2021-08-03 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2021-08-03 14:42 UTC (permalink / raw)
  To: Yajun Deng, davem, kuba, dsahern; +Cc: linux-decnet-user, netdev

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 <yajun.deng@linux.dev>
> ---
>  net/decnet/dn_fib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info
  2021-08-03  7:37 [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info Yajun Deng
  2021-08-03 14:42 ` David Ahern
@ 2021-08-03 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-03 21:30 UTC (permalink / raw)
  To: Yajun Deng; +Cc: davem, kuba, dsahern, linux-decnet-user, netdev

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 <yajun.deng@linux.dev>
> ---
>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-03 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  7:37 [PATCH net-next] net: decnet: Fix refcount warning for new dn_fib_info Yajun Deng
2021-08-03 14:42 ` David Ahern
2021-08-03 21:30 ` patchwork-bot+netdevbpf

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).