From: Glenn Washburn Date: Fri, 18 Mar 2022 06:51:32 +0000 (-0500) Subject: net/net: Avoid unnecessary calls to grub_net_tcp_retransmit() X-Git-Tag: grub-2.12-rc1~414 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=848724273e4;p=thirdparty%2Fgrub.git net/net: Avoid unnecessary calls to grub_net_tcp_retransmit() In grub_net_poll_cards_idle_real(), only call grub_net_tcp_retransmit() if there are network cards found. If there are no network card found, there can be no tcp sockets to transmit on. So no need to go through that logic. Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper --- diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 3eac83d16..11b39877b 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1580,7 +1580,8 @@ grub_net_poll_cards_idle_real (void) || ctime >= card->last_poll + card->idle_poll_delay_ms) receive_packets (card, 0); } - grub_net_tcp_retransmit (); + if (grub_net_cards == NULL) + grub_net_tcp_retransmit (); } /* Read from the packets list*/