diff options
-rw-r--r-- | kernel/module.c | 8 |
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) | |||
310 | { | 310 | { |
311 | /* Reallocation required? */ | 311 | /* Reallocation required? */ |
312 | if (pcpu_num_used + 1 > pcpu_num_allocated) { | 312 | if (pcpu_num_used + 1 > pcpu_num_allocated) { |
313 | int *new = kmalloc(sizeof(new[0]) * pcpu_num_allocated*2, | 313 | int *new; |
314 | GFP_KERNEL); | 314 | |
315 | new = krealloc(pcpu_size, sizeof(new[0])*pcpu_num_allocated*2, | ||
316 | GFP_KERNEL); | ||
315 | if (!new) | 317 | if (!new) |
316 | return 0; | 318 | return 0; |
317 | 319 | ||
318 | memcpy(new, pcpu_size, sizeof(new[0])*pcpu_num_allocated); | ||
319 | pcpu_num_allocated *= 2; | 320 | pcpu_num_allocated *= 2; |
320 | kfree(pcpu_size); | ||
321 | pcpu_size = new; | 321 | pcpu_size = new; |
322 | } | 322 | } |
323 | 323 | ||