The range is stored as exclusive, not inclusive. Subtracts one to get
the inclusive interval for the calculation. This fixes crashes when 32bit
addresses are in use.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
switch (info) {
case amdgpu_sw_info_address32_hi:
if (dev->vamgr_high_32.va_max)
- *val32 = dev->vamgr_high_32.va_max >> 32;
+ *val32 = (dev->vamgr_high_32.va_max - 1) >> 32;
else
- *val32 = dev->vamgr_32.va_max >> 32;
+ *val32 = (dev->vamgr_32.va_max - 1) >> 32;
return 0;
}
return -EINVAL;