USB: android: Increment disable_depth on usb_add_config() failure
When ADB is enabled, bind_config() callback should be called after
receiving functionfs_ready_callback(). This ensures stringtabs is
populated by __ffs_data_got_strings() before calling
bind_config() callback.
If usb_add_config() fails, then on next composition switch with ADB,
bind_config() callback will be called from enable_store() instead of
being called from functionfs_ready_callback(). This will lead to a crash
as stringtabs is not populated.
So, whenever usb_add_config() fails increment the disable_depth in
android_enable(), so as to avoid calling bind_config() callback from
enable_store().
CRs-fixed: 772342
Change-Id: I93065d2b59569518c33400381aac5cd6e5c7333a
Signed-off-by:
Azhar Shaikh <azhars@codeaurora.org>
Loading
Please register or sign in to comment