usb: gadget: ecm: cleanup IPA upon unbinding
This fix solves an issue where upon unbinding of the Std-ECM
driver, the IPA bridge does not de-initialiazed, so on the next binding
of the driver, the IPA bridge re-initialization fails. This will fix
a crash during dynamic composition switching.
Change-Id: I5165246a362131a7c03a98265c267538873a1bb0
CRs-fixed: 462413
Signed-off-by: Amit Blay <ablay@codeaurora.org>
diff --git a/drivers/usb/gadget/f_qc_ecm.c b/drivers/usb/gadget/f_qc_ecm.c
index 51f0e50..46a6bba 100644
--- a/drivers/usb/gadget/f_qc_ecm.c
+++ b/drivers/usb/gadget/f_qc_ecm.c
@@ -849,6 +849,10 @@
usb_ep_free_request(ecm->notify, ecm->notify_req);
ecm_qc_string_defs[1].s = NULL;
+
+ if (ecm->xport == USB_GADGET_XPORT_BAM2BAM_IPA)
+ ecm_ipa_cleanup(ipa_params.ipa_priv);
+
kfree(ecm);
}