Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-17 16:12:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-18 09:15:17 +0200
commitcbe4d8c077e7ad4345c12bdded0c54f9e4979a9f (patch)
treee3641cbb047a7aab9ed37aae9cf0d999db866552
parent954e2ed41fec684048824230eb51bed0eae449ba (diff)
Revert "usb: gadget: inode.c: fix unbalanced spin_lock in ep0_write"
This reverts commit abb540b5397674243994c5327146b6fed7339b71 which is commit b7bd98b7db9f upstream. I had added it to make another patch apply cleanly, but as Ben points out, that was wrong. Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: David Eccher <d.eccher@gmail.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
-rw-r--r--drivers/usb/gadget/legacy/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 352c59cff5b6..368d07937848 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1231,10 +1231,11 @@ 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);
--dev->udc_usage;
if (retval < 0) {
+ spin_lock_irq (&dev->lock);
clean_req (dev->gadget->ep0, dev->req);
+ spin_unlock_irq (&dev->lock);
} else
retval = len;