diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -2611,19 +2611,10 @@ redo: | |||
2611 | 2611 | ||
2612 | void kmem_cache_free(struct kmem_cache *s, void *x) | 2612 | void kmem_cache_free(struct kmem_cache *s, void *x) |
2613 | { | 2613 | { |
2614 | struct page *page; | 2614 | s = cache_from_obj(s, x); |
2615 | 2615 | if (!s) | |
2616 | page = virt_to_head_page(x); | ||
2617 | |||
2618 | if (kmem_cache_debug(s) && page->slab_cache != s) { | ||
2619 | pr_err("kmem_cache_free: Wrong slab cache. %s but object" | ||
2620 | " is from %s\n", page->slab_cache->name, s->name); | ||
2621 | WARN_ON_ONCE(1); | ||
2622 | return; | 2616 | return; |
2623 | } | 2617 | slab_free(s, virt_to_head_page(x), x, _RET_IP_); |
2624 | |||
2625 | slab_free(s, page, x, _RET_IP_); | ||
2626 | |||
2627 | trace_kmem_cache_free(_RET_IP_, x); | 2618 | trace_kmem_cache_free(_RET_IP_, x); |
2628 | } | 2619 | } |
2629 | EXPORT_SYMBOL(kmem_cache_free); | 2620 | EXPORT_SYMBOL(kmem_cache_free); |