aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2017-01-22 22:22:34 -0500
committerMoyster <oysterized@gmail.com>2018-05-16 13:24:14 +0200
commitaebe0949b646cd43d8b85ad8a268c269d6a5d9e3 (patch)
treea5f5be780af11ca6c21f2a76e57c3f1fc4e51885
parent423f49a5638a6e83aa6989244d13b49cc2b98dba (diff)
add missing cache_from_obj !PageSlab check
Taken from PaX.
-rw-r--r--mm/slab.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/slab.h b/mm/slab.h
index 88c3b15ed..da8768c8a 100644
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -220,6 +220,7 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
return s;
page = virt_to_head_page(x);
+ BUG_ON(!PageSlab(page));
cachep = page->slab_cache;
if (slab_equal_or_root(cachep, s))
return cachep;