Re: [PATCH v4 09/21] usb: ether: Fix error handling in usb_ether_init

2022-09-29 Thread Simon Glass
On Sun, 25 Sept 2022 at 02:30, Michal Suchanek wrote: > > 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 o

[PATCH v4 09/21] usb: ether: Fix error handling in usb_ether_init

2022-09-25 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