From: Konstantin Khlebnikov Date: Mon, 14 Jan 2019 10:38:43 +0000 (+0300) Subject: net/core/neighbour: fix kmemleak minimal reference count for hash tables X-Git-Tag: v4.19.88~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91e161b62d13851f71644c3fa6c02ec5b4e46388;p=thirdparty%2Fkernel%2Fstable.git net/core/neighbour: fix kmemleak minimal reference count for hash tables [ Upstream commit 01b833ab44c9e484060aad72267fc7e71beb559b ] This should be 1 for normal allocations, 0 disables leak reporting. Signed-off-by: Konstantin Khlebnikov Reported-by: Cong Wang Fixes: 85704cb8dcfd ("net/core/neighbour: tell kmemleak about hash tables") Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 4721793babed5..7597afee70680 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -370,7 +370,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);