[PATCH u-boot-marvell 01/13] tools: kwboot: Initialize rfds to zero
Marek Behún
kabel at kernel.org
Mon Oct 25 15:12:52 CEST 2021
From: Pali Rohár <pali at kernel.org>
Explicitly zero out the rfds fd_set with FD_ZERO() before using it.
Signed-off-by: Pali Rohár <pali at kernel.org>
Reviewed-by: Marek Behún <marek.behun at nic.cz>
---
tools/kwboot.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 7e1be29623..695d433b96 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1151,6 +1151,7 @@ kwboot_terminal(int tty)
fd_set rfds;
int nfds = 0;
+ FD_ZERO(&rfds);
FD_SET(tty, &rfds);
nfds = nfds < tty ? tty : nfds;
--
2.32.0
More information about the U-Boot
mailing list