File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ static inline unsigned long mmap_base(unsigned long rnd,
51
51
{
52
52
unsigned long gap = rlim_stack -> rlim_cur ;
53
53
unsigned long pad = stack_maxrandom_size () + stack_guard_gap ;
54
- unsigned long gap_min , gap_max ;
55
54
56
55
/* Values close to RLIM_INFINITY can overflow. */
57
56
if (gap + pad > gap )
@@ -61,13 +60,7 @@ static inline unsigned long mmap_base(unsigned long rnd,
61
60
* Top of mmap area (just below the process stack).
62
61
* Leave at least a ~128 MB hole.
63
62
*/
64
- gap_min = SZ_128M ;
65
- gap_max = (STACK_TOP / 6 ) * 5 ;
66
-
67
- if (gap < gap_min )
68
- gap = gap_min ;
69
- else if (gap > gap_max )
70
- gap = gap_max ;
63
+ gap = clamp (gap , SZ_128M , (STACK_TOP / 6 ) * 5 );
71
64
72
65
return PAGE_ALIGN (STACK_TOP - gap - rnd );
73
66
}
You can’t perform that action at this time.
0 commit comments