From: Robert Baldyga Date: Mon, 10 Mar 2014 08:33:37 +0000 (+0100) Subject: usb: gadget: f_fs: add missing spinlock and mutex unlock X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11a71ed7e9dabce3dd597a628147dbaf54825cee;p=platform%2Fkernel%2Flinux-3.10.git 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 Acked-by: Michal Nazarewicz Acked-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman [backport from upstream commit 48968f8d5f2234fb1768c55cf7d96d0b87446cd6] Signed-off-by: Marek Szyprowski Change-id: I48968f8d5f2234fb1768c55cf7d96d0b87446cd6 --- diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 1b70c83..dd4b563 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;