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

Commit f4700d93 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: ffs: fix: Always call ffs_closed() in ffs_data_clear()"

parents 1dbf0ee3 7374ac1f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -317,7 +317,6 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
				return ret;
			}

			set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags);
			return len;
		}
		break;
@@ -1583,7 +1582,6 @@ static void ffs_data_clear(struct ffs_data *ffs)
	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))
	ffs_closed(ffs);

	/* Dump ffs->gadget and ffs->flags */
@@ -3540,9 +3538,13 @@ static int ffs_ready(struct ffs_data *ffs)
	ffs_obj->desc_ready = true;
	ffs_obj->ffs_data = ffs;

	if (ffs_obj->ffs_ready_callback)
	if (ffs_obj->ffs_ready_callback) {
		ret = ffs_obj->ffs_ready_callback(ffs);
		if (ret)
			goto done;
	}

	set_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags);
done:
	ffs_dev_unlock();
	return ret;
@@ -3562,7 +3564,8 @@ static void ffs_closed(struct ffs_data *ffs)

	ffs_obj->desc_ready = false;

	if (ffs_obj->ffs_closed_callback)
	if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) &&
	    ffs_obj->ffs_closed_callback)
		ffs_obj->ffs_closed_callback(ffs);

	if (ffs_obj->opts)