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

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

Merge "USB: android: Check ffs->state in ffs_ready_callback"

parents 877baca0 7908c801
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -697,18 +697,17 @@ static int functionfs_ready_callback(struct ffs_data *ffs)
	struct android_dev *dev = ffs_function.android_dev;
	struct functionfs_config *config = ffs_function.config;

	if (dev)
		mutex_lock(&dev->mutex);
	if (!dev)
		return -ENODEV;

	mutex_lock(&dev->mutex);
	config->data = ffs;
	config->opened = true;

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

	if (dev)
	mutex_unlock(&dev->mutex);

	return 0;
}