Re: [PATCH] usb: gadget: avoid using gadget after freed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lianwei Wang <lianwei.wang@xxxxxxxxx> 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 <lianwei.wang@xxxxxxxxx>

I can't actually understand what's the problem here. The gadget is not
deleted when we disconnect the cable.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux