Skip to content

Commit 557ea25

Browse files
xairytorvalds
authored andcommitted
kasan, slab: remove redundant kasan_slab_alloc hooks
kasan_slab_alloc() calls in kmem_cache_alloc() and kmem_cache_alloc_node() are redundant as they are already called via slab_alloc/slab_alloc_node()-> slab_post_alloc_hook()->kasan_slab_alloc(). Remove them. Link: http://lkml.kernel.org/r/4ca1655cdcfc4379c49c50f7bf80f81c4ad01485.1550602886.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Qian Cai <cai@lca.pw> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Evgeniy Stepanov <eugenis@google.com> Cc: Kostya Serebryany <kcc@google.com> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 51dedad commit 557ea25

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

mm/slab.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3547,7 +3547,6 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
35473547
{
35483548
void *ret = slab_alloc(cachep, flags, _RET_IP_);
35493549

3550-
ret = kasan_slab_alloc(cachep, ret, flags);
35513550
trace_kmem_cache_alloc(_RET_IP_, ret,
35523551
cachep->object_size, cachep->size, flags);
35533552

@@ -3637,7 +3636,6 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
36373636
{
36383637
void *ret = slab_alloc_node(cachep, flags, nodeid, _RET_IP_);
36393638

3640-
ret = kasan_slab_alloc(cachep, ret, flags);
36413639
trace_kmem_cache_alloc_node(_RET_IP_, ret,
36423640
cachep->object_size, cachep->size,
36433641
flags, nodeid);

0 commit comments

Comments
 (0)