summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLeonard Anderweit <[email protected]>2025-11-20 09:38:55 +0100
committerJerome Forissier <[email protected]>2025-12-01 10:37:06 +0100
commitc10e1c2eded4783b8f4650da879ebae2beffcce6 (patch)
tree0541a226f9e4861365ccee0f12ec7c70b6a2cbdf /net
parent14ece61178f4e604d62de1bc1cb15aa2013d6338 (diff)
net: tftp: Remove tftp_init_load_addr error path
tftp_init_load_addr() always returns 0 since commit af45c84871e4 ("tftp: rework the logic to validate the load address"), so we don't need to check if it failed and can remove the error handling. Also change tftp_init_load_addr() to static void since the return value is now unused. Signed-off-by: Leonard Anderweit <[email protected]> Reviewed-by: Yannic Moog <[email protected]>
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 1760877107f..3b0f4cd2006 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -714,10 +714,9 @@ static void tftp_timeout_handler(void)
}
}
-static int tftp_init_load_addr(void)
+static void tftp_init_load_addr(void)
{
tftp_load_addr = image_load_addr;
- return 0;
}
static int saved_tftp_block_size_option;
@@ -901,13 +900,7 @@ void tftp_start(enum proto_t protocol)
} else
#endif
{
- if (tftp_init_load_addr()) {
- eth_halt();
- net_set_state(NETLOOP_FAIL);
- puts("\nTFTP error: ");
- puts("trying to overwrite reserved memory...\n");
- return;
- }
+ tftp_init_load_addr();
printf("Load address: 0x%lx\n", tftp_load_addr);
puts("Loading: *\b");
tftp_state = STATE_SEND_RRQ;
@@ -953,12 +946,7 @@ void tftp_start_server(void)
{
tftp_filename[0] = 0;
- if (tftp_init_load_addr()) {
- eth_halt();
- net_set_state(NETLOOP_FAIL);
- puts("\nTFTP error: trying to overwrite reserved memory...\n");
- return;
- }
+ tftp_init_load_addr();
printf("Using %s device\n", eth_get_name());
printf("Listening for TFTP transfer on %pI4\n", &net_ip);
printf("Load address: 0x%lx\n", tftp_load_addr);