Re: [PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init

2022-10-17 Thread Simon Glass
The code checks the return value from uclass_first_device as well as that the device exists but it passes on the return value which may be zero if there are no gadget devices. Just check that a device was returned and return -ENODEV otherwise. Also remove the dev variable which is not really used

[PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init

2022-10-12 Thread Michal Suchanek
The code checks the return value from uclass_first_device as well as that the device exists but it passes on the return value which may be zero if there are no gadget devices. Just check that a device was returned and return -ENODEV otherwise. Also remove the dev variable which is not really used