If there are no TCP sockets, this call to grub_get_time_ms is unneeded. This
prevents a call into the firmware on some platforms.

Signed-off-by: Glenn Washburn <developm...@efficientek.com>
---
 grub-core/net/tcp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c
index e8ad34b84d..75461eb54e 100644
--- a/grub-core/net/tcp.c
+++ b/grub-core/net/tcp.c
@@ -362,8 +362,13 @@ void
 grub_net_tcp_retransmit (void)
 {
   grub_net_tcp_socket_t sock;
-  grub_uint64_t ctime = grub_get_time_ms ();
-  grub_uint64_t limit_time = ctime - TCP_RETRANSMISSION_TIMEOUT;
+  grub_uint64_t ctime = 0, limit_time = 0;
+
+  if (tcp_sockets)
+    {
+      ctime = grub_get_time_ms ();
+      limit_time = ctime - TCP_RETRANSMISSION_TIMEOUT;
+    }
 
   FOR_TCP_SOCKETS (sock)
   {
-- 
2.27.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to