diff options
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 10c086afa2f4..2e164dca08e8 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) | |||
802 | if (io_data->aio) { | 802 | if (io_data->aio) { |
803 | req = usb_ep_alloc_request(ep->ep, GFP_KERNEL); | 803 | req = usb_ep_alloc_request(ep->ep, GFP_KERNEL); |
804 | if (unlikely(!req)) | 804 | if (unlikely(!req)) |
805 | goto error; | 805 | goto error_lock; |
806 | 806 | ||
807 | req->buf = data; | 807 | req->buf = data; |
808 | req->length = io_data->len; | 808 | req->length = io_data->len; |
@@ -817,7 +817,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) | |||
817 | ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC); | 817 | ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC); |
818 | if (unlikely(ret)) { | 818 | if (unlikely(ret)) { |
819 | usb_ep_free_request(ep->ep, req); | 819 | usb_ep_free_request(ep->ep, req); |
820 | goto error; | 820 | goto error_lock; |
821 | } | 821 | } |
822 | ret = -EIOCBQUEUED; | 822 | ret = -EIOCBQUEUED; |
823 | 823 | ||
@@ -865,6 +865,10 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) | |||
865 | 865 | ||
866 | mutex_unlock(&epfile->mutex); | 866 | mutex_unlock(&epfile->mutex); |
867 | return ret; | 867 | return ret; |
868 | |||
869 | error_lock: | ||
870 | spin_unlock_irq(&epfile->ffs->eps_lock); | ||
871 | mutex_unlock(&epfile->mutex); | ||
868 | error: | 872 | error: |
869 | kfree(data); | 873 | kfree(data); |
870 | return ret; | 874 | return ret; |