Re: [PATCH u-boot-marvell 01/13] tools: kwboot: Initialize rfds to zero

Stefan Roese
2021-10-26T05:41:48Z

On 25.10.21 15:12, Marek Behún wrote:
> From: Pali Rohár <pali@kernel.org>
>
> 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>

Thanks,
Stefan

> ---
> 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;
>
>

Viele Grüße,
Stefan

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de