Kernel: Fix invalid jump in case RDRAND fails

If RDRAND doesn't give us data, we want to try again, not jump to some
low address like 0x80 :^)
This commit is contained in:
Andreas Kling 2020-05-20 19:52:09 +02:00
parent a51adf27bf
commit 57b86fd082
Notes: sideshowbarker 2024-07-19 06:18:51 +09:00

View file

@ -35,9 +35,9 @@ static u32 random32()
if (g_cpu_supports_rdrand) {
u32 value = 0;
asm volatile(
"1%=:\n"
"1:\n"
"rdrand %0\n"
"jnc 1%=\n"
"jnc 1b\n"
: "=r"(value));
return value;
}