diff options
-rw-r--r-- | include/linux/mm.h | 2 | ||||
-rw-r--r-- | mm/memory.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index f80d0194c9bc..80fc92a49649 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1952,7 +1952,7 @@ extern int expand_downwards(struct vm_area_struct *vma, | |||
1952 | #if VM_GROWSUP | 1952 | #if VM_GROWSUP |
1953 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1953 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1954 | #else | 1954 | #else |
1955 | #define expand_upwards(vma, address) do { } while (0) | 1955 | #define expand_upwards(vma, address) (0) |
1956 | #endif | 1956 | #endif |
1957 | 1957 | ||
1958 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1958 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
diff --git a/mm/memory.c b/mm/memory.c index ca920d1fd314..d7e497e98f46 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2593,7 +2593,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
2593 | if (prev && prev->vm_end == address) | 2593 | if (prev && prev->vm_end == address) |
2594 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; | 2594 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; |
2595 | 2595 | ||
2596 | expand_downwards(vma, address - PAGE_SIZE); | 2596 | return expand_downwards(vma, address - PAGE_SIZE); |
2597 | } | 2597 | } |
2598 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { | 2598 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { |
2599 | struct vm_area_struct *next = vma->vm_next; | 2599 | struct vm_area_struct *next = vma->vm_next; |
@@ -2602,7 +2602,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
2602 | if (next && next->vm_start == address + PAGE_SIZE) | 2602 | if (next && next->vm_start == address + PAGE_SIZE) |
2603 | return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; | 2603 | return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; |
2604 | 2604 | ||
2605 | expand_upwards(vma, address + PAGE_SIZE); | 2605 | return expand_upwards(vma, address + PAGE_SIZE); |
2606 | } | 2606 | } |
2607 | return 0; | 2607 | return 0; |
2608 | } | 2608 | } |