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:
Azhar Shaikh <azhars@codeaurora.org>
Loading
Please register or sign in to comment