Commit ccaec5ad authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Kleber Sacilotto de Souza

net/core/neighbour: fix kmemleak minimal reference count for hash tables

BugLink: https://bugs.launchpad.net/bugs/1855313

[ Upstream commit 01b833ab ]

This should be 1 for normal allocations, 0 disables leak reporting.
Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reported-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Fixes: 85704cb8 ("net/core/neighbour: tell kmemleak about hash tables")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 789dfc35
......@@ -332,7 +332,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
buckets = (struct neighbour __rcu **)
__get_free_pages(GFP_ATOMIC | __GFP_ZERO,
get_order(size));
kmemleak_alloc(buckets, size, 0, GFP_ATOMIC);
kmemleak_alloc(buckets, size, 1, GFP_ATOMIC);
}
if (!buckets) {
kfree(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment