Revert "bug on kmem_cache_free with the wrong cache"

This reverts commit 8df273c856.
This commit is contained in:
Ksawlii 2024-12-13 19:44:18 +01:00
parent 2952f0d34d
commit e2bbab2d22

View file

@ -510,14 +510,10 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
return s;
cachep = virt_to_cache(x);
#ifdef CONFIG_BUG_ON_DATA_CORRUPTION
BUG_ON(cachep && cachep != s);
#else
if (WARN(cachep && cachep != s,
"%s: Wrong slab cache. %s but object is from %s\n",
__func__, s->name, cachep->name))
print_tracking(cachep, x);
#endif
return cachep;
}