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

Commit 6a0167e2 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: Check error status before doing epfile I/O"

parents a669c529 6ed8bf3c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -769,6 +769,9 @@ static ssize_t ffs_epfile_io(struct file *file,

	pr_debug("%s: len %zu, read %d\n", __func__, len, read);

	if (atomic_read(&epfile->error))
		return -ENODEV;

	goto first_try;
	do {
		spin_unlock_irq(&epfile->ffs->eps_lock);
@@ -945,6 +948,7 @@ ffs_epfile_release(struct inode *inode, struct file *file)

	atomic_set(&epfile->error, 1);
	ffs_data_closed(epfile->ffs);
	file->private_data = NULL;

	return 0;
}
@@ -1586,12 +1590,12 @@ static void ffs_func_eps_disable(struct ffs_function *func)

	spin_lock_irqsave(&func->ffs->eps_lock, flags);
	do {
		atomic_set(&epfile->error, 1);
		/* pending requests get nuked */
		if (likely(ep->ep)) {
			usb_ep_disable(ep->ep);
			ep->ep->driver_data = NULL;
		}
		atomic_set(&epfile->error, 1);
		epfile->ep = NULL;

		++ep;