aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-10-25 15:12:52 +0200
committerStefan Roese <sr@denx.de>2021-11-03 06:45:26 +0100
commit0a14341cf8f60e6a9ba2edb0802507cbb073e806 (patch)
tree2929969b648488ba5c1d3476e21bd33cf1b5e2ea /tools
parent03a8a5e26a32d842ce2c92be9dc9b9d1b10c9057 (diff)
downloadu-boot-0a14341cf8f60e6a9ba2edb0802507cbb073e806.zip
u-boot-0a14341cf8f60e6a9ba2edb0802507cbb073e806.tar.gz
u-boot-0a14341cf8f60e6a9ba2edb0802507cbb073e806.tar.bz2
tools: kwboot: Initialize rfds to zero
Explicitly zero out the rfds fd_set with FD_ZERO() before using it. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/kwboot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index 7e1be29..695d433 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;