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

Commit 2d22df56 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_fs: Allow only one adb daemon perform device open"

parents 0966f303 ff579867
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -699,6 +699,9 @@ static int ffs_ep0_open(struct inode *inode, struct file *file)
	if (unlikely(ffs->state == FFS_CLOSING))
		return -EBUSY;

	if (atomic_read(&ffs->opened))
		return -EBUSY;

	file->private_data = ffs;
	ffs_data_opened(ffs);

@@ -1406,9 +1409,15 @@ static void ffs_data_clear(struct ffs_data *ffs)
{
	ENTER();

	pr_debug("%s: ffs->gadget= %p, ffs->flags= %lu\n", __func__,
						ffs->gadget, ffs->flags);
	if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags))
		functionfs_closed_callback(ffs);

	/* Dump ffs->gadget and ffs->flags */
	if (ffs->gadget)
		pr_err("%s: ffs->gadget= %p, ffs->flags= %lu\n", __func__,
						ffs->gadget, ffs->flags);
	BUG_ON(ffs->gadget);

	if (ffs->epfiles)