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.

Signed-off-by: Leonard Anderweit <[email protected]>
---
 net/tftp.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/net/tftp.c b/net/tftp.c
index 1760877107fa..18f72b6a74ac 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -901,13 +901,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 +947,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);
-- 
2.43.0

Reply via email to