mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
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: 79976892f7
("net: convert fib_treeref from int to refcount_t")
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20210803073739.22339-1-yajun.deng@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c8f6c77d06
commit
bebc3bbf51
1 changed files with 1 additions and 1 deletions
|
@ -389,7 +389,7 @@ struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct nlattr *att
|
||||||
return ofi;
|
return ofi;
|
||||||
}
|
}
|
||||||
|
|
||||||
refcount_inc(&fi->fib_treeref);
|
refcount_set(&fi->fib_treeref, 1);
|
||||||
refcount_set(&fi->fib_clntref, 1);
|
refcount_set(&fi->fib_clntref, 1);
|
||||||
spin_lock(&dn_fib_info_lock);
|
spin_lock(&dn_fib_info_lock);
|
||||||
fi->fib_next = dn_fib_info_list;
|
fi->fib_next = dn_fib_info_list;
|
||||||
|
|
Loading…
Reference in a new issue