net: lwip: check if network device is available in do_dhcp

eth_get_dev() returns NULL if no network device is available.
Not checking the return value leads to a crash when the device
pointer is dereferenced.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
(cherry picked from commit d701c6ab42)
This commit is contained in:
Heinrich Schuchardt
2024-12-05 20:17:36 +01:00
committed by Simon Glass
parent 7afa4e9a30
commit e1bf38e096

Diff Content Not Available