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

Commit b7bd98b7 authored by David Eccher's avatar David Eccher Committed by Felipe Balbi
Browse files

usb: gadget: inode.c: fix unbalanced spin_lock in ep0_write



Fix bad unlock balance: ep0_write enter with the locks locked from
inode.c:1769, hence it must exit with spinlock held to avoid double
unlock in dev_config.

Signed-off-by: default avatarDavid Eccher <d.eccher@gmail.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d0450272
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1137,10 +1137,9 @@ ep0_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
						dev->gadget->ep0, dev->req,
						GFP_KERNEL);
				}
				if (retval < 0) {
				spin_lock_irq(&dev->lock);
				if (retval < 0) {
					clean_req (dev->gadget->ep0, dev->req);
					spin_unlock_irq (&dev->lock);
				} else
					retval = len;