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

Commit 624e7688 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_fs: Fix NULL pointer issues in ffs driver"

parents 0c354b99 3290d93a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1805,10 +1805,18 @@ static void ffs_data_closed(struct ffs_data *ffs)
static struct ffs_data *ffs_data_new(const char *dev_name)
{
	char ipcname[24] = "usb_ffs_";
	struct ffs_dev *ffs_dev;
	struct ffs_data *ffs = kzalloc(sizeof *ffs, GFP_KERNEL);
	if (unlikely(!ffs))
		return NULL;

	ffs_dev = _ffs_find_dev(dev_name);
	if (ffs_dev && ffs_dev->mounted) {
		pr_info("%s(): %s Already mounted\n", __func__, dev_name);
		kfree(ffs);
		return ERR_PTR(-EBUSY);
	}

	ENTER();

	ffs->io_completion_wq = alloc_ordered_workqueue("%s", 0, dev_name);