Lianwei Wang writes: > The udc and gadget device will be deleted when udc device is > disconnected and the related function will be unbind with it. > > But if the configfs is not deleted, then the function object > will be kept and the bound status is kept true. > > Then after udc device is connected again and a new udc and > gadget objects will be created and passed to bind interface. > But because the bound is still true, the new gadget is not > updated to netdev and a previous freed gadget will be used > in netdev after bind. > > To fix this using after freed issue, always set the gadget > object to netdev in bind interface. > > Signed-off-by: Lianwei Wang I can't actually understand what's the problem here. The gadget is not deleted when we disconnect the cable. -- balbi