From: Pekka Enberg Date: Tue, 8 May 2007 07:24:58 +0000 (-0700) Subject: module: use krealloc X-Git-Tag: upstream/snapshot3+hdmi~34612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d4f9c55002544bac1c99d0bab46c89319ab876e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git module: use krealloc 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 Signed-off-by: Linus Torvalds --- diff --git a/kernel/module.c b/kernel/module.c index 1eb8ca5..9bdbd12 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -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; }