From 588fa2b3886fc9fd60bb7de0795a89f283396243 Mon Sep 17 00:00:00 2001 From: robert-hh Date: Sat, 7 Feb 2026 10:18:17 +0100 Subject: [PATCH] extmod/modlwip: Always set the lwip_socket_ioctl() return value. If the return value is set only when certain condition are true, the compiler sometimes raises an error. Signed-off-by: robert-hh --- extmod/modlwip.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extmod/modlwip.c b/extmod/modlwip.c index 185d5b0492..59ef54ca08 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -1579,13 +1579,12 @@ static mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_ } lwip_socket_obj_t *socket = MP_OBJ_TO_PTR(self_in); - mp_uint_t ret; + mp_uint_t ret = 0; MICROPY_PY_LWIP_ENTER if (request == MP_STREAM_POLL) { uintptr_t flags = arg; - ret = 0; if (flags & MP_STREAM_POLL_RD) { if (socket->state == STATE_LISTENING) { @@ -1691,7 +1690,6 @@ static mp_uint_t lwip_socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_ socket->pcb.tcp = NULL; socket->state = _ERR_BADF; - ret = 0; } MICROPY_PY_LWIP_EXIT