summaryrefslogtreecommitdiff
path: root/Kernel/Random.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-20 19:52:09 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-20 19:54:56 +0200
commit57b86fd082ca78b396d611dc1812921c69107b5e (patch)
tree303f1e4963c811a3e1843f85edce3a779d89ab2d /Kernel/Random.cpp
parenta51adf27bfef7ded8f35a8563c6fa6a3d068412c (diff)
downloadserenity-57b86fd082ca78b396d611dc1812921c69107b5e.zip
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 :^)
Diffstat (limited to 'Kernel/Random.cpp')
-rw-r--r--Kernel/Random.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Random.cpp b/Kernel/Random.cpp
index b5c61b2b20..288af64b8f 100644
--- a/Kernel/Random.cpp
+++ b/Kernel/Random.cpp
@@ -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;
}