mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
slub: don't confuse ctor and dtor
kmem_cache_create() was swapping ctor and dtor in calling find_mergeable(): though it caused no bug, and probably never would, even if destructors are retained; but fix it so as not to generate anxiety ;) Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1abd727ed7
commit
1800782016
@ -2522,7 +2522,7 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
|
|||||||
struct kmem_cache *s;
|
struct kmem_cache *s;
|
||||||
|
|
||||||
down_write(&slub_lock);
|
down_write(&slub_lock);
|
||||||
s = find_mergeable(size, align, flags, dtor, ctor);
|
s = find_mergeable(size, align, flags, ctor, dtor);
|
||||||
if (s) {
|
if (s) {
|
||||||
s->refcount++;
|
s->refcount++;
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user