U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leonard Anderweit <l.anderweit@phytec.de>
To: <u-boot@lists.denx.de>
Cc: <joe.hershberger@ni.com>, <rfried.dev@gmail.com>,
	<jerome.forissier@linaro.org>
Subject: [PATCH] net: tftp: Remove tftp_init_load_addr error path
Date: Wed, 19 Nov 2025 09:37:09 +0100	[thread overview]
Message-ID: <20251119083709.2000844-1-l.anderweit@phytec.de> (raw)

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 <l.anderweit@phytec.de>
---
 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	other threads:[~2025-11-19  8:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  8:37 Leonard Anderweit [this message]
2025-11-20  8:07 ` [PATCH] net: tftp: Remove tftp_init_load_addr error path Yannic Moog

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251119083709.2000844-1-l.anderweit@phytec.de \
    --to=l.anderweit@phytec.de \
    --cc=jerome.forissier@linaro.org \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox