]> git.baikalelectronics.ru Git - uboot.git/commit
net: eth-uclass: Do not set device on error
authorMichal Suchanek <msuchanek@suse.de>
Wed, 12 Oct 2022 19:58:02 +0000 (21:58 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
commit717411919572c10dcb0addd4632aa6a9ee080a62
treedecfaa2e3b46282f620107579f7ab855de591d8e
parentd0e430dff1ca72a7c2c1a946400e3a9659ca1047
net: eth-uclass: Do not set device on error

eth_get_dev relies on the broken behavior that returns an error but not
the device on which the error happened which gives the caller no
reasonable way to report or handle the error.

In a later patch uclass_first_device_err will be changed to return the
device on error but eth_get_dev stores the returned device pointer
directly in a global state without checking the return value. Unset the
pointer again in the error case.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
net/eth-uclass.c