Currently, we silently ignore the return value of netops->read_rom_hwaddr().
This naturally is bad and we should check if the code ran successfully.

Signed-off-by: Olliver Schinagl <oli...@schinagl.nl>
---
 net/eth-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index c88b032868..024136a7cb 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -511,8 +511,8 @@ static int eth_post_probe(struct udevice *dev)
                pdata->enetaddr_src = ENETADDR_SRC_EEPROM;
        else
                /* Check if the device driver has a MAC address */
-               if (eth_get_ops(dev)->read_rom_hwaddr) {
-                       eth_get_ops(dev)->read_rom_hwaddr(dev);
+               if (eth_get_ops(dev)->read_rom_hwaddr &&
+                   !eth_get_ops(dev)->read_rom_hwaddr(dev)) {
                        pdata->enetaddr_src = ENETADDR_SRC_DRIVER;
                }
 
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to