usb: gadget: f_midi: unlock on error

We added some new locking here, but missed an error path where we need
to unlock.

Fixes: 9acdf4df2f ('usb: gadget: f_midi: added spinlock on transmit function')
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Dan Carpenter 2016-04-02 07:51:08 +03:00 committed by Felipe Balbi
parent 6490865c67
commit 4fc50ba596
1 changed files with 3 additions and 1 deletions

View File

@ -611,8 +611,10 @@ static void f_midi_transmit(struct f_midi *midi)
do { do {
ret = f_midi_do_transmit(midi, ep); ret = f_midi_do_transmit(midi, ep);
if (ret < 0) if (ret < 0) {
spin_unlock_irqrestore(&midi->transmit_lock, flags);
goto drop_out; goto drop_out;
}
} while (ret); } while (ret);
spin_unlock_irqrestore(&midi->transmit_lock, flags); spin_unlock_irqrestore(&midi->transmit_lock, flags);