Prevent long type overflow of realmem calculation on ILP32 by forcing
calculation to be in quad_t space. Fix style issue with second parameter to qmin(). Reported by: alc Reviewed by: bde, alc
This commit is contained in:
parent
1a006f7d56
commit
0060bab556
@ -332,8 +332,8 @@ init_param2(long physpages)
|
||||
* available kernel memory (physical or kmem).
|
||||
* At most it can be 3/4 of available kernel memory.
|
||||
*/
|
||||
realmem = qmin(physpages * PAGE_SIZE,
|
||||
VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS);
|
||||
realmem = qmin((quad_t)physpages * PAGE_SIZE,
|
||||
VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS);
|
||||
maxmbufmem = realmem / 2;
|
||||
TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem);
|
||||
if (maxmbufmem > (realmem / 4) * 3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user