File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 14
14
#define pr_fmt (fmt ) KBUILD_MODNAME ": " fmt
15
15
16
16
#include <linux/slab.h>
17
- #include <linux/kmemleak.h>
18
17
#include <linux/types.h>
19
18
#include <linux/kernel.h>
20
19
#include <linux/module.h>
@@ -538,14 +537,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
538
537
ret = kmalloc (sizeof (* ret ), GFP_ATOMIC );
539
538
if (!ret )
540
539
return NULL ;
541
- if (size <= PAGE_SIZE ) {
542
- buckets = kzalloc (size , GFP_ATOMIC );
543
- } else {
544
- buckets = (struct neighbour __rcu * * )
545
- __get_free_pages (GFP_ATOMIC | __GFP_ZERO ,
546
- get_order (size ));
547
- kmemleak_alloc (buckets , size , 1 , GFP_ATOMIC );
548
- }
540
+ buckets = kvzalloc (size , GFP_ATOMIC );
549
541
if (!buckets ) {
550
542
kfree (ret );
551
543
return NULL ;
@@ -562,15 +554,8 @@ static void neigh_hash_free_rcu(struct rcu_head *head)
562
554
struct neigh_hash_table * nht = container_of (head ,
563
555
struct neigh_hash_table ,
564
556
rcu );
565
- size_t size = (1 << nht -> hash_shift ) * sizeof (struct neighbour * );
566
- struct neighbour __rcu * * buckets = nht -> hash_buckets ;
567
557
568
- if (size <= PAGE_SIZE ) {
569
- kfree (buckets );
570
- } else {
571
- kmemleak_free (buckets );
572
- free_pages ((unsigned long )buckets , get_order (size ));
573
- }
558
+ kvfree (nht -> hash_buckets );
574
559
kfree (nht );
575
560
}
576
561
You can’t perform that action at this time.
0 commit comments