Merge tag 'gvt-next-fixes-2021-04-21' of https://github.com/intel/gvt-linux into...
[linux-2.6-microblaze.git] / include / linux / slub_def.h
index 1be0ed5..dcde82a 100644 (file)
@@ -7,6 +7,7 @@
  *
  * (C) 2007 SGI, Christoph Lameter
  */
+#include <linux/kfence.h>
 #include <linux/kobject.h>
 #include <linux/reciprocal_div.h>
 
@@ -185,6 +186,8 @@ static inline unsigned int __obj_to_index(const struct kmem_cache *cache,
 static inline unsigned int obj_to_index(const struct kmem_cache *cache,
                                        const struct page *page, void *obj)
 {
+       if (is_kfence_address(obj))
+               return 0;
        return __obj_to_index(cache, page_address(page), obj);
 }