summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2014-03-10 09:33:37 +0100
committerMarek Szyprowski <m.szyprowski@samsung.com>2014-06-11 11:02:21 +0200
commit5884c2412d484d87b30cab6a6493bb43c83d8288 (patch)
treed11eabb6b669cc094cb5914a3eb73364805948e9
parentc05102aafcd0ad4e749135790be9531c6b488a35 (diff)
downloadlinux-3.10-5884c2412d484d87b30cab6a6493bb43c83d8288.tar.gz
linux-3.10-5884c2412d484d87b30cab6a6493bb43c83d8288.tar.bz2
linux-3.10-5884c2412d484d87b30cab6a6493bb43c83d8288.zip
usb: gadget: f_fs: add missing spinlock and mutex unlock
This patch adds missing spin_unlock and mutex_unlock calls in error handling code. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [backport from upstream commit 48968f8d5f2234fb1768c55cf7d96d0b87446cd6] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-id: I48968f8d5f2234fb1768c55cf7d96d0b87446cd6
-rw-r--r--drivers/usb/gadget/f_fs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 10af75f3301..5daf173c335 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -802,7 +802,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
if (io_data->aio) {
req = usb_ep_alloc_request(ep->ep, GFP_KERNEL);
if (unlikely(!req))
- goto error;
+ goto error_lock;
req->buf = data;
req->length = io_data->len;
@@ -817,7 +817,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
if (unlikely(ret)) {
usb_ep_free_request(ep->ep, req);
- goto error;
+ goto error_lock;
}
ret = -EIOCBQUEUED;
@@ -865,6 +865,10 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
mutex_unlock(&epfile->mutex);
return ret;
+
+error_lock:
+ spin_unlock_irq(&epfile->ffs->eps_lock);
+ mutex_unlock(&epfile->mutex);
error:
kfree(data);
return ret;