diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -2865,7 +2865,6 @@ static inline void verify_redzone_free(struct kmem_cache *cache, void *obj) | |||
2865 | static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, | 2865 | static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, |
2866 | unsigned long caller) | 2866 | unsigned long caller) |
2867 | { | 2867 | { |
2868 | struct page *page; | ||
2869 | unsigned int objnr; | 2868 | unsigned int objnr; |
2870 | struct slab *slabp; | 2869 | struct slab *slabp; |
2871 | 2870 | ||
@@ -2873,9 +2872,7 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp, | |||
2873 | 2872 | ||
2874 | objp -= obj_offset(cachep); | 2873 | objp -= obj_offset(cachep); |
2875 | kfree_debugcheck(objp); | 2874 | kfree_debugcheck(objp); |
2876 | page = virt_to_head_page(objp); | 2875 | slabp = virt_to_slab(objp); |
2877 | |||
2878 | slabp = page->slab_page; | ||
2879 | 2876 | ||
2880 | if (cachep->flags & SLAB_RED_ZONE) { | 2877 | if (cachep->flags & SLAB_RED_ZONE) { |
2881 | verify_redzone_free(cachep, objp); | 2878 | verify_redzone_free(cachep, objp); |
@@ -3087,7 +3084,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, | |||
3087 | struct slab *slabp; | 3084 | struct slab *slabp; |
3088 | unsigned objnr; | 3085 | unsigned objnr; |
3089 | 3086 | ||
3090 | slabp = virt_to_head_page(objp)->slab_page; | 3087 | slabp = virt_to_slab(objp); |
3091 | objnr = (unsigned)(objp - slabp->s_mem) / cachep->size; | 3088 | objnr = (unsigned)(objp - slabp->s_mem) / cachep->size; |
3092 | slab_bufctl(slabp)[objnr] = BUFCTL_ACTIVE; | 3089 | slab_bufctl(slabp)[objnr] = BUFCTL_ACTIVE; |
3093 | } | 3090 | } |