Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d4f9c55002544bac1c99d0bab46c89319ab876e
Commit:     6d4f9c55002544bac1c99d0bab46c89319ab876e
Parent:     fe08a9d4982d9618ec25760ea715c46fe051e508
Author:     Pekka Enberg <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:24:58 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:00 2007 -0700

    module: use krealloc
    
    This converts an open-coded krealloc() to use the shiny new API.
    
    Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
    Acked-by: Rusty Russell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/module.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

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;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to