Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Robert Baldyga and committed by
Greg Kroah-Hartman
48968f8d dad4babe

+6 -2
+6 -2
drivers/usb/gadget/f_fs.c
··· 802 802 if (io_data->aio) { 803 803 req = usb_ep_alloc_request(ep->ep, GFP_KERNEL); 804 804 if (unlikely(!req)) 805 - goto error; 805 + goto error_lock; 806 806 807 807 req->buf = data; 808 808 req->length = io_data->len; ··· 817 817 ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC); 818 818 if (unlikely(ret)) { 819 819 usb_ep_free_request(ep->ep, req); 820 - goto error; 820 + goto error_lock; 821 821 } 822 822 ret = -EIOCBQUEUED; 823 823 ··· 865 865 866 866 mutex_unlock(&epfile->mutex); 867 867 return ret; 868 + 869 + error_lock: 870 + spin_unlock_irq(&epfile->ffs->eps_lock); 871 + mutex_unlock(&epfile->mutex); 868 872 error: 869 873 kfree(data); 870 874 return ret;