summaryrefslogtreecommitdiff
path: root/kernel/module.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2007-05-08 00:24:58 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:15:00 -0700
commit6d4f9c55002544bac1c99d0bab46c89319ab876e (patch)
treeaea768f9ea94966d7fca165368ee10adf194525f /kernel/module.c
parentfe08a9d4982d9618ec25760ea715c46fe051e508 (diff)
downloadlwn-6d4f9c55002544bac1c99d0bab46c89319ab876e.tar.gz
lwn-6d4f9c55002544bac1c99d0bab46c89319ab876e.zip
module: use krealloc
This converts an open-coded krealloc() to use the shiny new API. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 1eb8ca565ba0..9bdbd1217a6f 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;
}