From 96c434a25d32a8a7132b7eb7aa9427e080b9321b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 30 Aug 2022 18:27:59 +0800 Subject: [PATCH] random: use proper jiffies comparison macro stable inclusion from stable-v5.10.119 commit 9320e087f2b64257f34106eecbfe5a43be5199b0 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6BB Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9320e087f2b64257f34106eecbfe5a43be5199b0 -------------------------------- commit 8a5b8a4a4ceb353b4dd5bafd09e2b15751bcdb51 upstream. This expands to exactly the same code that it replaces, but makes things consistent by using the same macro for jiffy comparisons throughout. Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman Signed-off-by: Zheng Zengkai Acked-by: Xie XiuQi --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index f1c60f486196..40ad91e6e88e 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -326,7 +326,7 @@ static bool crng_has_old_seed(void) interval = max_t(unsigned int, CRNG_RESEED_START_INTERVAL, (unsigned int)uptime / 2 * HZ); } - return time_after(jiffies, READ_ONCE(base_crng.birth) + interval); + return time_is_before_jiffies(READ_ONCE(base_crng.birth) + interval); } /* -- GitLab