summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/mvebu/bubt.c2
-rw-r--r--cmd/net.c9
-rw-r--r--common/update.c10
-rw-r--r--net/net.c2
4 files changed, 12 insertions, 11 deletions
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index 2755c26cdf7..f8e97d03920 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -661,7 +661,7 @@ static size_t tftp_read_file(const char *file_name)
*/
image_load_addr = get_load_addr();
ret = net_loop(TFTPGET);
- return ret > 0 ? ret : 0;
+ return ret > 0 ? net_boot_file_size : 0;
}
static int is_tftp_active(void)
diff --git a/cmd/net.c b/cmd/net.c
index 24099764493..f6f556f36ae 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -354,8 +354,8 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
char *const argv[])
{
char *s;
- int rcode = 0;
- int size;
+ int rcode;
+ u32 size;
net_boot_file_name_explicit = false;
*net_boot_file_name = '\0';
@@ -396,8 +396,9 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
}
}
- size = net_loop(proto);
- if (size < 0) {
+ rcode = net_loop(proto);
+ size = net_boot_file_size;
+ if (rcode < 0) {
bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
return CMD_RET_FAILURE;
}
diff --git a/common/update.c b/common/update.c
index 6801b49479d..0bafffede9e 100644
--- a/common/update.c
+++ b/common/update.c
@@ -32,7 +32,7 @@ static uchar *saved_prot_info;
#endif
static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
{
- int size, rv;
+ int rv;
ulong saved_timeout_msecs;
int saved_timeout_count;
char *saved_netretry, *saved_bootfile;
@@ -54,12 +54,12 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
/* download the update file */
image_load_addr = addr;
copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name));
- size = net_loop(TFTPGET);
+ rv = net_loop(TFTPGET);
- if (size < 0)
+ if (rv < 0)
rv = 1;
- else if (size > 0)
- flush_cache(addr, size);
+ else
+ flush_cache(addr, net_boot_file_size);
/* restore changed globals and env variable */
tftp_timeout_ms = saved_timeout_msecs;
diff --git a/net/net.c b/net/net.c
index 8a8160e633f..ae3b977781f 100644
--- a/net/net.c
+++ b/net/net.c
@@ -692,7 +692,7 @@ restart:
eth_set_last_protocol(protocol);
- ret = net_boot_file_size;
+ ret = !!net_boot_file_size;
debug_cond(DEBUG_INT_STATE, "--- net_loop Success!\n");
goto done;