USB: android: Fix crash when F_FS gets descriptors before it is enabled
If F_FS (or ADB) function is selected in the composition, android
gadget driver keeps USB gadget disabled until it receives function
descriptors from userspace. This is signalled by F_FS when it calls
functionfs_ready_callback.
There could be a scenario (mainly due to userspace ignorance) that
before enabling F_FS (ADB) in the composition, descriptors are already
passed to F_FS. This results in a crash later on cable connection
in ffs_set_alt due to missing contexts initialization as functionfs_bind
never got called.
Fix this by calling functionfs_bind when F_FS is enabled by user and
it already has received the descriptors.
CRs-fixed: 585542
Change-Id: I52d680cdcd7f5d4a3eb90eb64785ea176c832849
Signed-off-by:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment