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

Commit 1548b13b authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

usb: gadget: Do not take BKL for gadget->ops->ioctl



There is no gadget driver in the tree that
actually implements the ioctl operation, so
obviously it is not necessary to hold the
BKL around the call.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 00b81fb2
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -714,9 +714,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
		struct ffs_function *func = ffs->func;
		ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
	} else if (gadget->ops->ioctl) {
		lock_kernel();
		ret = gadget->ops->ioctl(gadget, code, value);
		unlock_kernel();
	} else {
		ret = -ENOTTY;
	}
+2 −4
Original line number Diff line number Diff line
@@ -1299,11 +1299,9 @@ static long dev_ioctl (struct file *fd, unsigned code, unsigned long value)
	struct usb_gadget	*gadget = dev->gadget;
	long ret = -ENOTTY;

	if (gadget->ops->ioctl) {
		lock_kernel();
	if (gadget->ops->ioctl)
		ret = gadget->ops->ioctl (gadget, code, value);
		unlock_kernel();
	}

	return ret;
}