summaryrefslogtreecommitdiff
path: root/mm/slub.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-08-21 14:35:16 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-08-21 14:35:16 +0300
commit880e4f93f94677dff02f795352ed4f069ee046b7 (patch)
tree339be7ef0256eb6586180f014a8bd8f2f3e7fa72 /mm/slub.c
parent19d17d935b29f30510874fd34e93357eea0daba2 (diff)
parentd1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1 (diff)
downloadlinux-880e4f93f94677dff02f795352ed4f069ee046b7.tar.xz
Merge tag 'v5.3-rc5' into devel
Linux 5.3-rc5
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index e6c030e47364..8834563cdb4b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1432,7 +1432,9 @@ static inline bool slab_free_freelist_hook(struct kmem_cache *s,
void *old_tail = *tail ? *tail : *head;
int rsize;
- if (slab_want_init_on_free(s))
+ if (slab_want_init_on_free(s)) {
+ void *p = NULL;
+
do {
object = next;
next = get_freepointer(s, object);
@@ -1445,8 +1447,10 @@ static inline bool slab_free_freelist_hook(struct kmem_cache *s,
: 0;
memset((char *)object + s->inuse, 0,
s->size - s->inuse - rsize);
- set_freepointer(s, object, next);
+ set_freepointer(s, object, p);
+ p = object;
} while (object != old_tail);
+ }
/*
* Compiler cannot detect this function can be removed if slab_free_hook()