From: Pekka Enberg This converts an open-coded krealloc() to use the shiny new API. Signed-off-by: Pekka Enberg Acked-by: Rusty Russell Signed-off-by: Andrew Morton --- kernel/module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN kernel/module.c~module-use-krealloc kernel/module.c --- a/kernel/module.c~module-use-krealloc +++ a/kernel/module.c @@ -308,14 +308,14 @@ static int split_block(unsigned int i, u { /* 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; } _