Fix endless loop

Fix a while loop that can cause forever loop when cpuid instruction
doesn't work properly.

Change-Id: Iefa49d23b40c994eb4369621974a7d3c4067e47a
Signed-off-by: Amber Lin <Amber.Lin@amd.com>


[ROCm/ROCR-Runtime commit: 5815d9de9b]
This commit is contained in:
Amber Lin
2017-10-12 14:22:42 -04:00
orang tua 1d23f94a9b
melakukan a6fc0a8be1
+2 -1
Melihat File
@@ -354,7 +354,8 @@ static int cpuid_find_num_cache_leaves(uint32_t op)
do {
++idx;
cpuid_count(op, idx, &eax.full, &ebx.full, &ecx, &edx);
} while (eax.split.type != CACHE_TYPE_NULL);
/* Modern systems have cache levels up to 3. */
} while (eax.split.type != CACHE_TYPE_NULL && idx < 4);
return idx;
}