From 515381414d5ce2032fbee6bb55206061660762bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Fri, 6 Aug 2021 18:07:39 +0200 Subject: loadb: Properly indicate aborted kermit transfer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When k_recv() returns zero it indicates that kermit transfer was aborted. Function do_load_serial_bin() (caller of load_serial_bin()) interprets value ~0 as aborted transfer, so properly propagates information about aborted transfer from k_recv() to do_load_serial_bin(). Signed-off-by: Pali Rohár --- cmd/load.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmd/load.c') diff --git a/cmd/load.c b/cmd/load.c index 381ed1b..3904e13 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -535,6 +535,9 @@ static ulong load_serial_bin(ulong offset) udelay(1000); } + if (size == 0) + return ~0; /* Download aborted */ + flush_cache(offset, size); printf("## Total Size = 0x%08x = %d Bytes\n", size, size); -- cgit v1.1