Enable/Disable shall be banlanced when USB in secure mode
Otherwise the linked_func and func_list could be messed up
That will cause the unbinding release the wild memory
This is a Samsung platform only issue,kernel panic
Has the following mark:
configfs-gadget gadget:unbind function 'mtp'
configfs-gadget gadget:unbind function 'ptp'
Which shall not happen, since user could not choose
Both mtp and ptp together
Change-Id: I4aba691a0c4180f828c55aad5d63b9162c3f881a
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/
1451197
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
#else
cdev->next_string_id = 0;
#endif
+ if (!dev->secure) {
if (!gadget) {
pr_info("%s: Gadget is NULL: %p\n", __func__, gadget);
mutex_unlock(&dev->lock);
}
usb_gadget_connect(gadget);
+ }
dev->enabled = true;
#ifdef CONFIG_USB_TYPEC_MANAGER_NOTIFIER
set_usb_enable_state();