fm_eth_recv() returns -1 if the first receive descriptor is empty.
net_lwip_rx() only treats -EAGAIN as a non-fatal empty receive, so DHCP
can abort on an idle poll now that it checks net_lwip_poll().

Initialize the return value to -EAGAIN instead. Leave received-frame
handling and the zero return after discarding erroneous frames unchanged.

Fixes: 53a0ca3757fe ("net: lwip: finish DHCP before starting autoload")
Signed-off-by: James Hilliard <[email protected]>
---
 drivers/net/fm/eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index f0e7c0eca42..8b44a8ffae8 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -618,7 +618,7 @@ static int fm_eth_recv(struct udevice *dev, int flags, 
uchar **packetp)
        struct fm_port_bd *rxbd;
        u32 buf_lo, buf_hi;
        u16 status, len;
-       int ret = -1;
+       int ret = -EAGAIN;
        u8 *data;
 
        fm_eth = dev_get_priv(dev);

-- 
2.53.0

Reply via email to