提交 6d4f9c55 编写于 作者: P Pekka Enberg 提交者: Linus Torvalds

module: use krealloc

This converts an open-coded krealloc() to use the shiny new API.
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
Acked-by: NRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fe08a9d4
......@@ -310,14 +310,14 @@ static int split_block(unsigned int i, unsigned short size)
{
/* Reallocation required? */
if (pcpu_num_used + 1 > pcpu_num_allocated) {
int *new = kmalloc(sizeof(new[0]) * pcpu_num_allocated*2,
GFP_KERNEL);
int *new;
new = krealloc(pcpu_size, sizeof(new[0])*pcpu_num_allocated*2,
GFP_KERNEL);
if (!new)
return 0;
memcpy(new, pcpu_size, sizeof(new[0])*pcpu_num_allocated);
pcpu_num_allocated *= 2;
kfree(pcpu_size);
pcpu_size = new;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册