1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:47:34 +00:00

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

View file

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