diff options
-rw-r--r-- | mm/slab.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2881,6 +2881,8 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, | |||
2881 | unsigned int objnr; | 2881 | unsigned int objnr; |
2882 | struct slab *slabp; | 2882 | struct slab *slabp; |
2883 | 2883 | ||
2884 | BUG_ON(virt_to_cache(objp) != cachep); | ||
2885 | |||
2884 | objp -= obj_offset(cachep); | 2886 | objp -= obj_offset(cachep); |
2885 | kfree_debugcheck(objp); | 2887 | kfree_debugcheck(objp); |
2886 | page = virt_to_head_page(objp); | 2888 | page = virt_to_head_page(objp); |
@@ -3759,8 +3761,6 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp) | |||
3759 | { | 3761 | { |
3760 | unsigned long flags; | 3762 | unsigned long flags; |
3761 | 3763 | ||
3762 | BUG_ON(virt_to_cache(objp) != cachep); | ||
3763 | |||
3764 | local_irq_save(flags); | 3764 | local_irq_save(flags); |
3765 | debug_check_no_locks_freed(objp, obj_size(cachep)); | 3765 | debug_check_no_locks_freed(objp, obj_size(cachep)); |
3766 | __cache_free(cachep, objp); | 3766 | __cache_free(cachep, objp); |