diff options
-rw-r--r-- | common/spl/spl_ymodem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c index 20f42600625..8ad580d8ae5 100644 --- a/common/spl/spl_ymodem.c +++ b/common/spl/spl_ymodem.c @@ -44,7 +44,8 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset, while (info->image_read < offset) { res = xyzModem_stream_read(buf, BUF_SIZE, &err); if (res <= 0) - return res; + break; + info->image_read += res; } @@ -57,7 +58,7 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset, while (info->image_read < offset + size) { res = xyzModem_stream_read(buf, BUF_SIZE, &err); if (res <= 0) - return res; + break; memcpy(addr, buf, res); info->image_read += res; |