usb: gadget: f_fs: Allow only one adb daemon perform device open
As part of ffs_ep0_open(), atomic variable ffs.opened is set and as part of ffs_ep0_release() it is cleared. Also as part of release operation, in ffs_data_clear() ffs->gadget is set to NULL. If two adb daemons are running in parallel, then BUG ON is observed as part of release operation as ffs->gadget is not set to NULL. To fix the issue add check for ffs->opened to allow only one adb daemon perform device open. This ensures open and release operation are performed in serialized way and avoids any race. CRs-Fixed: 730155 Change-Id: Ifccdfa6068f506bb7dfdc9945b60591da530df8f Signed-off-by:Saket Saurabh <ssaurabh@codeaurora.org> Signed-off-by:
Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment