bug on cache_from_obj !PageSlab check
Signed-off-by: Daniel Micay <danielmicay@gmail.com> Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
This commit is contained in:
parent
8df273c856
commit
c12b6fe5f1
1 changed files with 4 additions and 0 deletions
|
@ -478,9 +478,13 @@ 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue