Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cc5d01e1 authored by Liangliang Lu's avatar Liangliang Lu Committed by Mayank Rana
Browse files

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: default avatarLiangliang Lu <luliang@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment