mirror of https://gitee.com/openkylin/linux.git
slob: fix bug - when slob allocates "struct kmem_cache", it does not force alignment.
This may trigger misaligned memory access exception. Acked-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
parent
b69d3987f4
commit
0701a9e649
|
@ -533,7 +533,8 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
|
||||||
{
|
{
|
||||||
struct kmem_cache *c;
|
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) {
|
if (c) {
|
||||||
c->name = name;
|
c->name = name;
|
||||||
|
|
Loading…
Reference in New Issue