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

Commit c2a2c324 authored by Liangliang Lu's avatar Liangliang Lu Committed by Gerrit - the friendly Code Review server
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>
parent 34f1071c
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