提交 239f49c0 编写于 作者: M MinChan Kim 提交者: Pekka Enberg

slob: Fix to return wrong pointer

Although slob_alloc return NULL, __kmalloc_node returns NULL + align.
Because align always can be changed, it is very hard for debugging
problem of no page if it don't return NULL.

We have to return NULL in case of no page.

[penberg@cs.helsinki.fi: fix formatting as suggested by Matt.]
Acked-by: NMatt Mackall <mpm@selenic.com>
Signed-off-by: NMinChan Kim <minchan.kim@gmail.com>
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
上级 f26a3988
......@@ -469,8 +469,9 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
return ZERO_SIZE_PTR;
m = slob_alloc(size + align, gfp, align, node);
if (m)
*m = size;
if (!m)
return NULL;
*m = size;
return (void *)m + align;
} else {
void *ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册