summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2024-09-02 15:25:11 +0200
committerTom Rini <trini@konsulko.com>2024-09-10 13:08:24 -0600
commit278e9ac8aa7c65e3709483cab5bf4231daea1295 (patch)
tree59a6f661d6f966e5528c112ab0a9f950b079958e /net/net.c
parentca55cf8104c0dd78aae45fa66dd8400ef1b3d0ac (diff)
net: guard call to tftp_start() with IS_ENABLED(CONFIG_CMD_TFTPBOOT)
net_auto_load() cannot call tftp_start() if CONFIG_CMD_TFTPBOOT is disabled. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/net/net.c b/net/net.c
index d9bc9df643f..1e0b7c85624 100644
--- a/net/net.c
+++ b/net/net.c
@@ -334,17 +334,22 @@ void net_auto_load(void)
net_set_state(NETLOOP_SUCCESS);
return;
}
- if (net_check_prereq(TFTPGET)) {
-/* We aren't expecting to get a serverip, so just accept the assigned IP */
- if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
- net_set_state(NETLOOP_SUCCESS);
- } else {
- printf("Cannot autoload with TFTPGET\n");
- net_set_state(NETLOOP_FAIL);
+ if (IS_ENABLED(CONFIG_CMD_TFTPBOOT)) {
+ if (net_check_prereq(TFTPGET)) {
+ /*
+ * We aren't expecting to get a serverip, so just
+ * accept the assigned IP
+ */
+ if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
+ net_set_state(NETLOOP_SUCCESS);
+ } else {
+ printf("Cannot autoload with TFTPGET\n");
+ net_set_state(NETLOOP_FAIL);
+ }
+ return;
}
- return;
+ tftp_start(TFTPGET);
}
- tftp_start(TFTPGET);
}
static int net_init_loop(void)