Revert "bug on cache_from_obj !PageSlab check"

This reverts commit c12b6fe5f1.
This commit is contained in:
Ksawlii 2024-12-13 19:44:18 +01:00
parent 6ae70539d5
commit 2952f0d34d

View file

@ -478,13 +478,9 @@ static inline struct kmem_cache *virt_to_cache(const void *obj)
struct page *page;
page = virt_to_head_page(obj);
#ifdef CONFIG_BUG_ON_DATA_CORRUPTION
BUG_ON(!PageSlab(page));
#else
if (WARN_ONCE(!PageSlab(page), "%s: Object is not a Slab page!\n",
__func__))
return NULL;
#endif
return page->slab_cache;
}