]> git.baikalelectronics.ru Git - uboot.git/commit
tools: kwboot: Fix kwboot_xm_sendblock() function when kwboot_tty_recv() fails
authorPali Rohár <pali@kernel.org>
Fri, 24 Sep 2021 21:06:43 +0000 (23:06 +0200)
committerStefan Roese <sr@denx.de>
Fri, 1 Oct 2021 09:07:13 +0000 (11:07 +0200)
commit93a45cb5b650530c392db557468e1eec47217311
tree51d2b215d7f65738a4f4055b38d98086099e0807
parenta444ba4f7a9310d06668298e3ffc0db65fa2d055
tools: kwboot: Fix kwboot_xm_sendblock() function when kwboot_tty_recv() fails

When kwboot_tty_recv() fails or times out, it does not set the `c`
variable to NAK. The variable is then compared, while it holds either
an undefined value or a value from previous iteration. Set `c` to NAK so
that the other side will try to resend current block, and remove the
now unnecessary break.

In other failure cases return immediately.

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>
tools/kwboot.c