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

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

Merge "USB: f_fs: Avoid NULL pointer dereference during epfile_io()"

parents 4d062ab6 f2eff0ef
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -997,7 +997,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
	struct ffs_epfile *epfile = file->private_data;
	struct usb_request *req;
	struct ffs_ep *ep;
	struct ffs_data *ffs = epfile->ffs;
	char *data = NULL;
	ssize_t ret, data_len = -EINVAL;
	int halt;
@@ -1096,7 +1095,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
			data_len = usb_ep_align_maybe(gadget, ep->ep, data_len);
		spin_unlock_irq(&epfile->ffs->eps_lock);

		extra_buf_alloc = ffs->gadget->extra_buf_alloc;
		extra_buf_alloc = gadget->extra_buf_alloc;
		if (!io_data->read)
			data = kmalloc(data_len + extra_buf_alloc,
					GFP_KERNEL);