aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempool.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
commita2e5790d841658485d642196dbb0927303d6c22f (patch)
treeb3d28c9bcb7da6880806146fd22a88a7ee7f733e /mm/mempool.c
parentab2d92ad881da11331280aedf612d82e61cb6d41 (diff)
parent60c3e026d73ccabb075fb70ba02f8512ab40cf2c (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - kasan updates - procfs - lib/bitmap updates - other lib/ updates - checkpatch tweaks - rapidio - ubsan - pipe fixes and cleanups - lots of other misc bits * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits) Documentation/sysctl/user.txt: fix typo MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns MAINTAINERS: update various PALM patterns MAINTAINERS: update "ARM/OXNAS platform support" patterns MAINTAINERS: update Cortina/Gemini patterns MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern MAINTAINERS: remove ANDROID ION pattern mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors mm: docs: fix parameter names mismatch mm: docs: fixup punctuation pipe: read buffer limits atomically pipe: simplify round_pipe_size() pipe: reject F_SETPIPE_SZ with size over UINT_MAX pipe: fix off-by-one error when checking buffer limits pipe: actually allow root to exceed the pipe buffer limits pipe, sysctl: remove pipe_proc_fn() pipe, sysctl: drop 'min' parameter from pipe-max-size converter kasan: rework Kconfig settings crash_dump: is_kdump_kernel can be boolean kernel/mutex: mutex_is_locked can be boolean ...
Diffstat (limited to 'mm/mempool.c')
-rw-r--r--mm/mempool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/mempool.c b/mm/mempool.c
index 7d8c5a0010a2..5c9dce34719b 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -103,10 +103,10 @@ static inline void poison_element(mempool_t *pool, void *element)
103} 103}
104#endif /* CONFIG_DEBUG_SLAB || CONFIG_SLUB_DEBUG_ON */ 104#endif /* CONFIG_DEBUG_SLAB || CONFIG_SLUB_DEBUG_ON */
105 105
106static void kasan_poison_element(mempool_t *pool, void *element) 106static __always_inline void kasan_poison_element(mempool_t *pool, void *element)
107{ 107{
108 if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) 108 if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc)
109 kasan_poison_kfree(element); 109 kasan_poison_kfree(element, _RET_IP_);
110 if (pool->alloc == mempool_alloc_pages) 110 if (pool->alloc == mempool_alloc_pages)
111 kasan_free_pages(element, (unsigned long)pool->pool_data); 111 kasan_free_pages(element, (unsigned long)pool->pool_data);
112} 112}
@@ -119,7 +119,7 @@ static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags)
119 kasan_alloc_pages(element, (unsigned long)pool->pool_data); 119 kasan_alloc_pages(element, (unsigned long)pool->pool_data);
120} 120}
121 121
122static void add_element(mempool_t *pool, void *element) 122static __always_inline void add_element(mempool_t *pool, void *element)
123{ 123{
124 BUG_ON(pool->curr_nr >= pool->min_nr); 124 BUG_ON(pool->curr_nr >= pool->min_nr);
125 poison_element(pool, element); 125 poison_element(pool, element);