diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2017-04-10 12:45:43 -0400 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2018-05-16 13:25:29 +0200 |
| commit | 722b80cdfb984ccb4bfdb4f07aad6ff33b61ae7d (patch) | |
| tree | 8e9e7673ff2635d739fed2e49a730a84aed1846f | |
| parent | bbd573a821a72ed4469eea0e457920ad9db53034 (diff) | |
add kmalloc alloc_size attributes
| -rw-r--r-- | include/linux/slub_def.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index fd2dfb600..bf3d7cae3 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -110,7 +110,7 @@ struct kmem_cache { }; void *kmem_cache_alloc(struct kmem_cache *, gfp_t); -void *__kmalloc(size_t size, gfp_t flags); +void *__kmalloc(size_t size, gfp_t flags) __attribute__((alloc_size(1))); static __always_inline void * kmalloc_order(size_t size, gfp_t flags, unsigned int order) @@ -147,7 +147,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) return kmalloc_order_trace(size, flags, order); } -static __always_inline void *kmalloc(size_t size, gfp_t flags) +static __always_inline __attribute__((alloc_size(1))) void *kmalloc(size_t size, gfp_t flags) { if (__builtin_constant_p(size)) { if (size > KMALLOC_MAX_CACHE_SIZE) @@ -167,7 +167,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) } #ifdef CONFIG_NUMA -void *__kmalloc_node(size_t size, gfp_t flags, int node); +void *__kmalloc_node(size_t size, gfp_t flags, int node) __attribute__((alloc_size(1))); void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); #ifdef CONFIG_TRACING |
