diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2614,6 +2614,13 @@ void kmem_cache_free(struct kmem_cache *s, void *x) | |||
2614 | 2614 | ||
2615 | page = virt_to_head_page(x); | 2615 | page = virt_to_head_page(x); |
2616 | 2616 | ||
2617 | if (kmem_cache_debug(s) && page->slab != s) { | ||
2618 | pr_err("kmem_cache_free: Wrong slab cache. %s but object" | ||
2619 | " is from %s\n", page->slab->name, s->name); | ||
2620 | WARN_ON_ONCE(1); | ||
2621 | return; | ||
2622 | } | ||
2623 | |||
2617 | slab_free(s, page, x, _RET_IP_); | 2624 | slab_free(s, page, x, _RET_IP_); |
2618 | 2625 | ||
2619 | trace_kmem_cache_free(_RET_IP_, x); | 2626 | trace_kmem_cache_free(_RET_IP_, x); |