usb: gadget: gsi: Defer freeing memory on free_inst if in use
In the case of gsi_free_inst() called, whole f_gst structure is freed.
GSI control related API like gsi_ctrl_dev_poll do not check if f_gsi
is freed or not, only check gsi_ctrl_port is NULL or not.
If GSI driver is opened by userspace, gsi_free_inst() is executed,
mark inst_exist to false but do not free instance structures and
deregister misc device until misc device is closed.
Besides, in the GSI control related API read/write/ioctl/poll,
check if GSI instance is freed or not.
Change-Id: I4245964989a1284f5180efb69b64bd63e9104059
Signed-off-by:
Liangliang Lu <luliang@codeaurora.org>
Loading
Please register or sign in to comment