If the probing of UDC controller failed
udc_name shall be NULL to avoid double unregistration
and the panic
It could happen in some corner case
Change-Id: I2e6e4168a505b86d8f1b57db53be91acc608ee97
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/
1438349
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
pr_err("Failed detaching UDC from gadget %d\n", ret);
} else {
ret = usb_gadget_probe_driver(&gi->composite.gadget_driver);
- if (ret)
+ if (ret) {
+ gi->composite.gadget_driver.udc_name = NULL;
pr_err("Failed attaching UDC to gadget %d\n", ret);
+ }
}
mutex_unlock(&gi->lock);