From 28a6a9a08f5e515f37aacd28f295daf1dd621f75 Mon Sep 17 00:00:00 2001 From: Alexander Richards Date: Thu, 13 May 2021 19:11:14 +0200 Subject: [PATCH] IDEChannel: Fix wait_until_not_busy() (#7084) The time_elapsed variable would count until milliseconds_timeout + 1, so a != comparision won't work. --- Kernel/Storage/IDEChannel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Storage/IDEChannel.cpp b/Kernel/Storage/IDEChannel.cpp index 9c7cb58fcd..91403b26ae 100644 --- a/Kernel/Storage/IDEChannel.cpp +++ b/Kernel/Storage/IDEChannel.cpp @@ -269,7 +269,7 @@ bool IDEChannel::wait_until_not_busy(bool slave, size_t milliseconds_timeout) IO::delay(1000); time_elapsed++; } - return time_elapsed != milliseconds_timeout; + return time_elapsed <= milliseconds_timeout; } bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout) @@ -279,7 +279,7 @@ bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout) IO::delay(1000); time_elapsed++; } - return time_elapsed != milliseconds_timeout; + return time_elapsed <= milliseconds_timeout; } String IDEChannel::channel_type_string() const