Skip to content

Commit

Permalink
Revert "usb: gadget: inode.c: fix unbalanced spin_lock in ep0_write"
Browse files Browse the repository at this point in the history
This reverts commit abb540b which is
commit b7bd98b 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
  • Loading branch information
Greg Kroah-Hartman committed Oct 18, 2017
1 parent 954e2ed commit cbe4d8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/gadget/legacy/inode.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit cbe4d8c

Please sign in to comment.