mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
usb: gadget: inode.c: fix unbalanced spin_lock in ep0_write
commit b7bd98b7db upstream.
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: David Eccher <d.eccher@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c030c36a88
commit
c2eb312f31
@@ -1140,10 +1140,9 @@ ep0_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||
dev->gadget->ep0, dev->req,
|
||||
GFP_KERNEL);
|
||||
}
|
||||
spin_lock_irq(&dev->lock);
|
||||
if (retval < 0) {
|
||||
spin_lock_irq (&dev->lock);
|
||||
clean_req (dev->gadget->ep0, dev->req);
|
||||
spin_unlock_irq (&dev->lock);
|
||||
} else
|
||||
retval = len;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user