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

Commit e0a1ca6a authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: android: Fix mutex issue if ffs_close runs after ADB disable



While switching from ADB to non-ADB composition, adbd is also
stopped. Since, stop adbd happens asynchronously, there is a
possibility that closed_callback gets called after ADB is
disabled. In that scenario, closed_callback wouldn't be able to
use android_dev->mutex and may race with ffs_enable resulting in
different issues/crashes.

Change-Id: I7941bbea72139b22eb0ec785c29e9bdb76b6f6a3
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent c9e6173b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -643,6 +643,8 @@ static int functionfs_ready_callback(struct ffs_data *ffs)

	config->data = ffs;
	config->opened = true;
	/* Save dev in case the adb function will get disabled */
	config->dev = dev;

	if (config->enabled && dev)
		android_enable(dev);