Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f97c2f5 authored by Azhar Shaikh's avatar Azhar Shaikh Committed by Matt Wagantall
Browse files

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: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent 0346ef1a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -466,6 +466,7 @@ static int android_enable(struct android_dev *dev)
			if (err < 0) {
				pr_err("%s: usb_add_config failed : err: %d\n",
						__func__, err);
				dev->disable_depth++;
				return err;
			}
		}