diff options
Diffstat (limited to 'mm/mempool.c')
-rw-r--r-- | mm/mempool.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mm/mempool.c b/mm/mempool.c index 9e075f829d0d..8f65464da5de 100644 --- a/mm/mempool.c +++ b/mm/mempool.c | |||
@@ -104,20 +104,16 @@ static inline void poison_element(mempool_t *pool, void *element) | |||
104 | 104 | ||
105 | static void kasan_poison_element(mempool_t *pool, void *element) | 105 | static void kasan_poison_element(mempool_t *pool, void *element) |
106 | { | 106 | { |
107 | if (pool->alloc == mempool_alloc_slab) | 107 | if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) |
108 | kasan_poison_slab_free(pool->pool_data, element); | 108 | kasan_poison_kfree(element); |
109 | if (pool->alloc == mempool_kmalloc) | ||
110 | kasan_kfree(element); | ||
111 | if (pool->alloc == mempool_alloc_pages) | 109 | if (pool->alloc == mempool_alloc_pages) |
112 | kasan_free_pages(element, (unsigned long)pool->pool_data); | 110 | kasan_free_pages(element, (unsigned long)pool->pool_data); |
113 | } | 111 | } |
114 | 112 | ||
115 | static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags) | 113 | static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags) |
116 | { | 114 | { |
117 | if (pool->alloc == mempool_alloc_slab) | 115 | if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) |
118 | kasan_slab_alloc(pool->pool_data, element, flags); | 116 | kasan_unpoison_slab(element); |
119 | if (pool->alloc == mempool_kmalloc) | ||
120 | kasan_krealloc(element, (size_t)pool->pool_data, flags); | ||
121 | if (pool->alloc == mempool_alloc_pages) | 117 | if (pool->alloc == mempool_alloc_pages) |
122 | kasan_alloc_pages(element, (unsigned long)pool->pool_data); | 118 | kasan_alloc_pages(element, (unsigned long)pool->pool_data); |
123 | } | 119 | } |