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

Commit 4d150bc9 authored by Azhar Shaikh's avatar Azhar Shaikh
Browse files

usb: gadget: f_gsi: Fix memory leak in f_gsi driver



Unconfiguring of gsi eps is done in gsi_disable(). gsi_disable() is
called in interrupt context. The freeing of trbs in case of cable
disconnect or composition switch is done from
ipa_disconnect_work_handler() which is a workqueue. So the calling
of this workqueue might get delayed most of times compared to
gsi_disable() and it will be executed earlier.
Since the endpoints will be unconfigured earlier, hence when
usb_gsi_ep_op() will be called with GSI_EP_OP_FREE_TRBS to free
the trbs, it will not be executed and will lead to a memory leak.
So move the unconfiguring of the eps after freeing of trbs.

Change-Id: I713e100424d30f234324cb823c2310d0fe4a4651
Signed-off-by: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent 19240e8d
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