xyz-modem: Close stream after processing/sending terminate sequence
authorPali Rohár <pali@kernel.org>
Tue, 3 Aug 2021 14:28:41 +0000 (16:28 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 3 Sep 2021 18:32:41 +0000 (14:32 -0400)
Obviously it is not possible to send terminate sequence over stream after
closing stream.

Signed-off-by: Pali Rohár <pali@kernel.org>
cmd/load.c

index 3904e13..e0c896b 100644 (file)
@@ -1009,8 +1009,8 @@ static ulong load_serial_ymodem(ulong offset, int mode)
                printf("%s\n", xyzModem_error(err));
        }
 
-       xyzModem_stream_close(&err);
        xyzModem_stream_terminate(false, &getcxmodem);
+       xyzModem_stream_close(&err);
 
 
        flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));