提交 0701a9e6 编写于 作者: Y Yi Li 提交者: Pekka Enberg

slob: fix bug - when slob allocates "struct kmem_cache", it does not force alignment.

This may trigger misaligned memory access exception.
Acked-by: NMatt Mackall <mpm@selenic.com>
Signed-off-by: NYi Li <yi.li@analog.com>
Signed-off-by: NBryan Wu <cooloney@kernel.org>
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
上级 b69d3987
......@@ -533,7 +533,8 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
{
struct kmem_cache *c;
c = slob_alloc(sizeof(struct kmem_cache), flags, 0, -1);
c = slob_alloc(sizeof(struct kmem_cache),
flags, ARCH_KMALLOC_MINALIGN, -1);
if (c) {
c->name = name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册