[PATCH 1/1] [mm/slob] fix bug - when slob allocates "struct kmem_cache", it does not force alignment.

From: Bryan Wu
Date: Fri Apr 25 2008 - 06:57:57 EST


From: Yi Li <yi.li@xxxxxxxxxx>

This may trigger misaligned memory access exception.

Signed-off-by: Yi Li <yi.li@xxxxxxxxxx>
Signed-off-by: Bryan Wu <cooloney@xxxxxxxxxx>
---
mm/slob.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/slob.c b/mm/slob.c
index e2c3c0e..6038cba 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -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;
--
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/