fix: add unrecoverable to avoid out of bound access

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-04 12:28:15 +00:00
committed by Compute-Runtime-Automation
parent 95eb5df978
commit ad2701ad26
7 changed files with 29 additions and 21 deletions

View File

@@ -165,12 +165,11 @@ template <>
uint32_t ProductHelperHw<gfxProduct>::computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const {
const uint32_t highestEnabledSlice = NEO::GfxCoreHelper::getHighestEnabledSlice(hwInfo);
UNRECOVERABLE_IF(highestEnabledSlice == 0);
UNRECOVERABLE_IF(hwInfo.gtSystemInfo.MaxSlicesSupported == 0);
auto subSlicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported;
auto maxSubSlice = highestEnabledSlice * subSlicesPerSlice;
if (highestEnabledSlice == 0) {
UNRECOVERABLE_IF(true);
}
return maxSubSlice;
}