commit 31be8309532a6743f301cb2e83bd12ca07988b09
tree 9f84911bae39b11247f2e62ed9d7d451ef4b0a2f
parent da63fc7ce63b43426dc3c69c05e28de2872c159a
author OGAWA Hirofumi <[EMAIL PROTECTED]> 1163668769 -0800
committer Linus Torvalds <[EMAIL PROTECTED]> 1163706218 -0800

[PATCH] Fix strange size check in __get_vm_area_node()

Recently, __get_vm_area_node() was changed like following

        if (unlikely(!area))
                return NULL;

-       if (unlikely(!size)) {
-               kfree (area);
+       if (unlikely(!size))
                return NULL;
-       }

It is leaking `area', also original code seems strange already.
Probably, we wanted to do this patch.

Signed-off-by: OGAWA Hirofumi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 mm/vmalloc.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 7dc6aa7..86897ee 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -181,14 +181,13 @@ static struct vm_struct *__get_vm_area_n
        }
        addr = ALIGN(start, align);
        size = PAGE_ALIGN(size);
+       if (unlikely(!size))
+               return NULL;
 
        area = kmalloc_node(sizeof(*area), gfp_mask & GFP_LEVEL_MASK, node);
        if (unlikely(!area))
                return NULL;
 
-       if (unlikely(!size))
-               return NULL;
-
        /*
         * We always allocate a guard page.
         */
-
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