net/core/neighbour: fix kmemleak minimal reference count for hash tables
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Mon, 14 Jan 2019 10:38:43 +0000 (13:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jan 2019 21:39:18 +0000 (13:39 -0800)
This should be 1 for normal allocations, 0 disables leak reporting.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Fixes: 85704cb8dcfd ("net/core/neighbour: tell kmemleak about hash tables")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c

index 3e27a779f2880c0706579f7e2e3110f4ad81c510..96fdc91347266e23290775fa8fbe0524fd3192fd 100644 (file)
@@ -450,7 +450,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);